Implementing Mobile SDK for IOS requires the steps below
Integration Key is generated by CDMP Platform while defining application. It is a hash string that contains information about the application.
At the beginning of your application cycle, you must set Integration Key.
Where to find your Integration Key
To locate the Integration Key for your mobile application: Settings > Integrations > Applications > Select your mobile app. Inside the application details, scroll to the Push Notifications section. You will see the Integration Key displayed there.
Call this method at the beginning of your application life cycle.
Recommendation: Use it on AppDelegate
After setting Integration Key, to use SDK features, Dengage.initWithLaunchOptions(withLaunchOptions: [UIApplication.LaunchOptionsKey: Any]?,badgeCountReset: Bool?) function must be called.
Parameters:
withLaunchOptions: [UIApplication.LaunchOptionsKey: Any]?:PassdidFinishLaunchingWithOptions params
badgeCountReset : boolAdditional Methods for Tracking and Geofencing:
To enable tracking and geofencing, you need to add the following methods in didFinishLaunchingWithOptions:
DengageGeofence.requestLocationPermissions()
DengageGeofence.startGeofence()
If you want to reset (clear) badge icon on your notifications set this option to true
Following sample shows how to do that in your AppDelegate.m file:
Sample: In the AppDelegate.m
If you want diffrent configuration instead of default configuration you can add options parameter:
In order to disable the automatic registerForRemoteNotifications call to the operating system, use the following code. In this case, you should be doing it in the application code. Add this code before initWithLaunchOptions
Subscription is self-managed by SDK.
Definition: Subscription is a process which is triggered by sending subscription event to Dengage. It contains necessary informations about application to send push notifications to clients.
Subcription cycle starts with Prompting user permission. SDK will automaticlly send subscription events under these circumstances;
Note: Android doesn't require to ask for push notifications explicitly. Therefore, you can only ask for push notification's permissions on iOS.
IOS uses shared UNUserNotificationCenter by itself while asking user to send notification. Dengage SDK manager uses UNUserNotificationCenter to ask permission as well.
Referrer:Apple Docs
If in your application, you want to get UserNotification permissions explicitly, you can do by calling one of the following methods:
Contact Key represents a value that has a relation with Devices and Contacts. There are two types of devices. Anonymous Devices and Contact Devices. Contact Devices contains Contact Key
To track devices by their contacts you need to set the contact key on SDK.
Recommended Usage: You should call this method, if you have user information. You should call in every app open and on login, logout pages.
If you need to get the current token or if you are managing the token subscription process manually, you can use setToken and getToken functions.
Old SDK method: Push tokens can be set by Dengage.setToken(token: String) method.
New SDK method: Push tokens can be set by Dengage.register(token: Data) method.
Definition : Push token is a data type which will be provided by APNS. By using token, CDMP can push notifications to client application.
promptForPushNotifications method will trigger func application( _ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) method for push token which has to be set by a method.
Also you can use getToken function for getting current token from D·engage SDK.
In order to disable the automatic registerForRemoteNotifications call to the operating system, use the following code. In this case, you should be doing it in the application code. Add this code before initWithLaunchOptions
If you manage your own user permission states on your application you may send user permission by using setUserPermission method.
SDK can provide logs for debugging. It displays queries and payloads which are sent to REST APIs.
To validate your inputs you can enable SDK log by a method.
SDK provides a method if you want to get and parse payload manually for custom parameters or etc.
You should use the protocol TAGCustomFunction.
TAGCustomFunction Protocol is automatically called by the tag manager internal SDK.
The execute function provides the dictionary which then can be feeded to our SDK for event collection
For GTM integration please refer
https://developers.google.com/tag-platform/tag-manager/ios/v5
https://developers.google.com/tag-platform/tag-manager/ios/v5/advanced-config
SDK supports URL schema deep link. If the target URL has a valid link, it will redirect to the related link.
disableOpenURLIf the link opens in both safari and application, you can prevent it from opening in safari by using the method below.
Troubleshooting
If you are sending push notifications from Dengage Dashboard, not getting any errors, but push notifications are not receiving to your devices, please follow steps described in Apple's Technical Note about Troubleshooting Push Notifications to verify if your device is successfully registering and receiving push notifications.
Here propertyID is the ios selector that you will be placing while creating campaign.
InApp inline element is the view that you will be placing where inapp inline is to be shown.
custom params is the dictionary for custom params filter that you will be placing on the panel while creating campaign.
screen name parameter is when the inapp inline is to be shown on the specific screen.
hide if not found is a parameter where user can tell the sdk whether hide the view if inappinline is not found.