Utility Methods (iOS)

Explore the iOS utility methods related to location permissions.

Set DeviceToken

The Roam SDK is capable of sending push notifications to your users. Click here to get the device token.

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
     Roam.setDeviceToken(deviceToken)
 }

Check Location Permission

Check if the location permissions for the app are enabled.

Roam.isLocationEnabled()

Location Permission Status

By using the locationPermissionStatus method you can check the location permission status.

Roam.locationPermissionStatus()

notDetermined = 0

restricted = 1

denied = 2

authorizedAlways = 3

authorizedWhenInUse = 4

Request Location Permission

Application request for the user location.

Roam.requestLocation()

Check Location Tracking

Check whether location tracking has started or not. This method returns a boolean value.

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()
        }

Last updated