ASAP for Mobile Platforms

Initializing the SDK in Your App

Next, you initialize the ASAP SDK in your app. 

The following three keys are crucial in this step:

  • Org ID
  • App ID
  • Datacenter

The values of these keys appear under the Code Snippet section in the setup page of the ASAP add-on in Zoho Desk.

To initialize the SDK in your app, perform the following steps. 

  1. Import the Zoho Desk Portal SDK framework into the AppDelegate file in your project.

    Swift

    import ZohoDeskPortalSDK

    Objective-C

    @import ZohoDeskPortalSDK;
  2. Paste the following initialization code into the application method with the didFinishLaunchingWithOptions argument.

    Swift

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
       let config = ZDPortalConfiguration()
       config.enableHelpCenter = true
       config.enableCreateTicket = true
       config.enableMyTicket = true
       config.enableCommunity = false
       ZohoDeskPortalSDK.initializeSDK(<#ORGID#>, appId: <#APPID#>, dataCenter: <#dataCenterValue#>, configuration: <#config#>)
       return true
    }

    Objective-C

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        ZDPortalConfiguration * config = [[ZDPortalConfiguration alloc]init];
        config.enableHelpCenter = YES;
        config.enableCommunity = YES;
        config.enableCreateTicket = YES;
        config.enableMyTicket = YES;
        [ZohoDeskPortalSDK initializeSDK:<#ORGID#> appId:<#APPID#> dataCenter:<#dataCenterValue#> configuration:<#config#>];
        return YES;
    }
Note:
Datacenter values according to the deployment type are as follows:
CN - ZDDataCenter.CN
EU - ZDDataCenter.EU
US - ZDDataCenter.US
IN - ZDDataCenter.IN