After successfully setting up the ASAP SDK on your mobile application, the next step is to integrate it.
To install the plugin in, run either of the below mentioned commands:
- flutter pub add zohodesk_portal_services
(or
add the following in pubspec.yaml
dependencies:
zohodesk_portal_services: version
How to resolve the ASAP SDK dependencies in your mobile app?
Android
The ASAP SDK's dependencies are available at maven.zohodl.com. To include them in your Android project, you must add the relevant Maven URLs to your project's build.gradle file.
To perform this, open the Android folder of your Flutter project in Android Studio and add the following Maven repository to the project-level build.gradle file.
iOS
There is no need to import iOS-specific dependencies separately into the project since the iOS SDK dependencies are automatically added to Flutter projects through the native part of the Flutter plugin.
How to initialize the SDK on Flutter apps?
The following three keys are essential to initialize the SDK in your app:
1 Organization ID (org Id)
2 App ID (app Id)
3 Data Center (DC)
To initialize the SDK, include the following code snippet in the initState() method of the main.dart file:
- import 'package:zohodesk_portal_apikit/zohodesk_portal_apikit.dart' show ZohodeskPortalApikit;
ZohodeskPortalApikit.initializeSDK(orgId, appId, dc);
The values of the keys, orgId, appId, and dc appear under the Code Snippet section in the setup page of the ASAP add-on in Zoho Desk.
Code is common for both iOS and Android platforms.
Data Centers (DCs), according to the deployment types:
CN - ZDPDataCenter.CN
EU - ZDPDataCenter.EU
US - ZDPDataCenter.US
IN - ZDPDataCenter.IN
AU - ZDPDataCenter.AU
JP - ZDPDataCenter.JP