Skip to content

Requesting Permissions

The Pulsate SDK requires the following permissions:

  1. Push Notifications — used to send push notifications to users.
  2. Foreground and Background Location — used for geofencing. For geofencing to work, the user must grant Precise Location and Allow Always.

The SDK does not request notification permission on your behalf. Request notification authorization and register for remote notifications from your app, at the moment you choose:

UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { granted, _ in
guard granted else { return }
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
}

Show your push priming screen before this call. Once your app is registered, the SDK picks up the device token through the forwarded AppDelegate callbacks (see AppDelegate Configuration).

The location prompt is shown when you call startLocation() on the manager — not at session start. Call it at the point you want to request location access (the SDK requests Always authorization):

pulsateManager.startLocation()

Show your location priming screen just before calling startLocation().

Add the following keys to your app’s Info.plist, each with a description of why location is used:

  • NSLocationWhenInUseUsageDescription
  • NSLocationAlwaysAndWhenInUseUsageDescription
  • NSLocationAlwaysUsageDescription

See Installing the iOS Pulsate SDK for details on configuring these keys.