Extending the App
You could further design and create new screens and functionalities for your app using your Zoho CRM data provided by the SDK APIs as per your requirements. There are no front-end restrictions in developing your app.
To ease your access to Zoho CRM Rest APIs, the SDK takes care of OAuth authentication, request and response structures of the REST APIs and returns defined Swift wrapped objects as API responses. Hence, a REST API invocation would just be a normal method call for the client app.
All Zoho CRM entities are modeled as Swift classes with a "ZCRM" prefix. For instance, ZCRMModule, ZCRMRecord, ZCRMUser and so on. The classes follow the hierarchy as per the entities in Zoho CRM. Every class is modeled with its respective properties and provision to access its child entities are given as methods.
Methods are provided in the ZCRMSDKUtil class to get the root level instances organization, modules and so on. Refer to our sample codes for more details.
Here is the class hierarchy of the various components of Zoho CRM iOS SDK.
Delegate Objects
To avoid unnecessary API calls to retrieve the metadata of a company or module, you can call the entity's object with its delegate method using the ZCRMSDKUtil class, and use the same delegate object to perform related operations of that entity.
Refreshing the Cache
If you have enabled caching, the SDK caches all metadata API responses by default, and renews the cache as per the configured cache validity time. If you want to refresh the cache before the validity time, use the methods suffixed with "FromServer", to ignore the local cache and get a response from the API.
Advancing the app
In certain business scenarios, the app is expected to perform certain advanced tasks like updating the UI of the app and notifying the developer about its status and more.
Sometimes the user initiates a download and goes to the background to access other applications. Once they re-enter the application from background to foreground (app layer), the SDK should be notified about the entry to synchronize the download progress.
The following method notifies if the user has entered the foreground when the download is running in the background.
public func notifyApplicationEnterForeground()
Sometimes the session may have many downloads running in the background. When a download is complete, the system calls a method to notify the app regarding download completion. The identifier of the session and completion handler is passed to this method from handleeventsforbackgroundurlsession method in AppDelegate. Calling this method lets the system know that your app’s user interface is updated and a new snapshot can be taken.
public func notifyBackgroundSessionEvent (_identifier : String, _ completionHandler : @escaping () -> Void)
The developer should pass the identifier of the session and completion handler to this method from the handleeventsforbackgroundurlsession method.
Parameters
identifier: The name of the URL session which invokes the application.
completionHandler: Call the completion handler of the handleeventsforbackgroundurlsession method.