B Bubbl Docs

Permissions (iOS)

1) Info.plist keys

Add clear user-facing copy for:

  • NSLocationWhenInUseUsageDescription
  • NSLocationAlwaysAndWhenInUseUsageDescription
  • NSLocationAlwaysUsageDescription

2) Background modes

Enable in Signing & Capabilities:

  • Background Modes > Location updates
  • Background Modes > Remote notifications

3) Request runtime permissions

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

BubblPlugin.shared.requestLocationWhenInUse()
BubblPlugin.shared.requestLocationAlways()

4) Observe permission state in app UI

.onReceive(BubblPlugin.locationAuthorizationPublisher) { status in
  // update UI
}
.onReceive(BubblPlugin.pushAuthorizationPublisher) { status in
  // update UI
}

5) Permission sequencing recommendation

  1. Explain value first
  2. Ask for push
  3. Ask for location when-in-use
  4. Ask for always location