Set DeviceToken
The Roam SDK is capable of sending push notifications to your users. to get the device token.
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
Roam.setDeviceToken(deviceToken)
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
[Roam setDeviceToken:deviceToken];
}
Check Location Permission
Check if the location permissions for the app are enabled.
Roam.isLocationEnabled()
[Roam isLocationEnabled];
Location Permission Status
By using the locationPermissionStatus
method you can check the location permission status.
Roam.locationPermissionStatus()
[Roam locationPermissionStatus];
Request Location Permission
Application request for the user location.
Roam.requestLocation()
[Roam requestLocation];
Check Location Tracking
Check whether location tracking has started or not. This method returns a boolean value.
Roam.isLocationTracking()
[Roam isLocationTracking];
Notification Opened Handler
By using this method inside the Notification delegate method you can track the campaign's impressions and counts.
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void)
{
Roam.notificationOpenedHandler(response)
completionHandler()
}
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler{
[Roam notificationOpenedHandler:response];
}