Not Every department in your company works the same, With the help of Zoho CRM SDKs not only you can create customised experiences for your CRM users but also build custom solutions on top of Zoho CRM to run your business.
Introducing SerWiz - A simple mobile app for service engineers, through which they could have a quick look at their assigned jobs, go on the field and get their job done, all of this using Zoho CRM as the backend/the source of data.
We'll be using the Zoho CRM iOS SDK to build our app for iPhone and iPad. We'll also be using Zoho CRM Portals to give restricted access to Service engineers.
Note: It's not necessary to know iOS Development to understand this post, although it helps if you know a bit of it.
Building a mobile app on Zoho CRM has two parts - Configuring Zoho CRM and building the mobile app in a particular platform, in this case, the iOS Platform.
Create a Client Portal for Zoho CRM. This will allow Service Engineers to login to Zoho CRM and access the data that has been disclosed to them
Add Service Engineers either as Contacts or through a custom module and invite them to the client portal we've just created. For simplicity, We will add them as Contacts for now.
Create a Custom Module for collecting Service Requests from Customer Complaints. This module will contain details like the affected product, details of the service request etc. Here we also ensure to add both the Customer and the Service Engineer as lookup fields so that we can associate them to the incoming service request.
Setup permission for Portal users,i.e Service Engineers so that they can access the necessary records in Zoho CRM.
Note: It is important to enable the Service Requests module and filter them by "Service Engineers" so that the Service Engineers in the portal will be shown their relevant Service requests
Zoho CRM iOS SDK is the easiest way to connect your app with Zoho CRM. The SDK takes care of all the heavy lifting that an app needs like Authentication, API calls, Data Parsing etc so that you can focus on delivering the best mobile experience to your users.
Prerequisites
A Mac Running MacOS Mojave or later
Download and Install XCode 10.2 or higher
Download and install Cocoapods, A Package Manager for iOS development
NPM
(Optional) A actual iOS device to test your app
Adding the Zoho CRM SDK to your XCode Project
You can also follow the instructions over here to setup Zoho CRM SDK for your project.
Before starting to code the app, it is always a good idea to visualize the flow of the app. Here's a simple flowchart for the same
Adding Authentication and Login to your iOS App
Authentication is the most important part of any application, and without proper authentication, one cannot access the underlying service.Building your own Authentication service is a pain, and there are so many things that could go wrong.
The Zoho CRM SDK takes care of Securing authentication using the iOS Keychain store to provide a highly secure login layer for your app.
Zoho CRM iOS SDK provides a very handy class ZVCRMLoginHandler for handling Login for Portal users. Note that this class is different from the ZCRMLoginHandler which lets Zoho CRM users login.
For more details on how this class is used, check out the AppDelegate.swift in the shared Project.
Fetching Records from Modules
Data is the core of any application and for our application, we are sourcing our data from Zoho CRM. The Zoho CRM iOS SDK provides native Swift APIs to connect with the back end and fetch the data required.
For our app, we need all the service requests for the existing user from the custom module "Service Requests". This is achieved by the following code
(For the detailed code, check ViewController.swift
file)
Once we get all the records from Zoho CRM, we can populate the list view in our application with the necessary details from the CRM records.
For example, we can access the name of the service request using this code
(For detailed code, check WorkOrderTableViewCell.swift
file)
Create and attach a note to a Service Request
Once the service engineer has completed the job, we create a note with details like - total time taken to complete the job, customer sign, payment reference number etc and add to the Service Request.
Creating and adding a note is very simple using the CRM SDK, this is the code snippet as follows
(For detailed code, check `CompletionViewController.swift`)
I've shared the link to source code so that you can have a look at the code, although I've redacted the Client ID and Client Secret because I've used my personal Zoho account. Check out the Readme.md file to know more about how the code is structured.
With a blend of good user interface and the Zoho CRM SDK, you can create custom mobile solutions in no time. This particular project, although very minimal, took me a weekend (around ~8-10 hours) to code. A fully fleshed out app might take a couple weeks or more depending on the app's requirement.
If you are interested to know more about creating custom mobile solutions, I'll be available in Zoholics Developers, from Oct 1 - Oct 3, representing Zoho Catalyst, would love to catch up with you to know more about what you are working on.
Source Code - https://zdrive.li/RYiswO
Writer is a powerful online word processor, designed for collaborative work.