Permissions
struct · Swiftobject · Kotlinobject · TypeScriptfinal class · DartBubbl.permissions reads where the device stands on notifications and location, and asks for them. BubblPermissionStatus is what it answers with.
Asking through Bubbl.permissions shows Bubbl's privacy view first when the dashboard says so, then the system prompt. It works from anywhere in the app, with no activity or view controller of yours. You don't have to use it: Bubbl follows whatever permission your app holds, however it was granted. More in Permissions and privacy.
Bubbl.permissions#
Every function answers null (nil on iOS) before start, and on a device below the runtime minimum. openSettings() works before start, since it needs nothing from Bubbl.
Bubbl.permissions is the object Bubbl.Permissions. From Java, call Bubbl.Permissions.status() and the callback functions, which are @JvmStatic.
status(): BubblPermissionStatus?Android onlynull before start.suspend fun requestNotifications(): BubblPermissionStatus?Android onlysuspend fun requestLocation(always: Boolean = false): BubblPermissionStatus?Android onlyalways for geofences while it's closed. Android asks for "Allow all the time" in a second step.requestNotifications(callback: Bubbl.Callback<BubblPermissionStatus?>)Android onlyrequestNotifications() with the result delivered on the main thread.requestLocation(always: Boolean, callback: Bubbl.Callback<BubblPermissionStatus?>)Android onlyrequestLocation(always) with the result delivered on the main thread. always has no default here.openSettings()Android onlystart it uses the context App Startup gives Bubbl, so it does nothing if the app removed Bubbl's App Startup initializer.Bubbl.permissions is a BubblPermissions (public struct BubblPermissions: Sendable). iOS shows each prompt only once: after a refusal, send the user to openSettings().
func status() -> BubblPermissionStatus?iOS onlynil before start, and can be nil just after it, until Bubbl's first look.func requestNotifications() async -> BubblPermissionStatus?iOS onlyfunc requestLocation(always: Bool = false) async -> BubblPermissionStatus?iOS onlyalways, the second step from "While Using" to "Always" too.func requestNotifications(completion: @escaping @MainActor @Sendable (BubblPermissionStatus?) -> Void)iOS onlyrequestNotifications() for code that can't await. completion runs on the main thread.func requestLocation(always: Bool, completion: @escaping @MainActor @Sendable (BubblPermissionStatus?) -> Void)iOS onlyrequestLocation(always:) for code that can't await. always has no default here.func openSettings()iOS onlyBubbl.permissions is a BubblPermissions (final class, with no public constructor). Every function is asynchronous, status() included.
Future<BubblPermissionStatus?> status()Flutter onlynull before start.Future<BubblPermissionStatus?> requestNotifications()Flutter onlyFuture<BubblPermissionStatus?> requestLocation({bool always = false})Flutter onlyalways for geofences while it's closed, which the system asks for in a second step.Future<void> openSettings()Flutter onlyBubbl.permissions is a plain object. Every function but openSettings returns a promise, status() included.
status(): Promise<BubblPermissionStatus | null>React Native onlynull before start.requestNotifications(): Promise<BubblPermissionStatus | null>React Native onlyrequestLocation(options?: { always?: boolean }): Promise<BubblPermissionStatus | null>React Native only{ always: true } for geofences while it's closed, as a second step. Takes an options object, not a boolean.openSettings(): voidReact Native onlyBubblPermissionStatus#
Where the device stands on the permissions Bubbl uses.
data class BubblPermissionStatus(notifications, location, preciseLocation).
public struct BubblPermissionStatus: Sendable, Equatable. Apps get it from Bubbl; it has no public initializer.
class BubblPermissionStatus, with the two permissions as top-level enums.
openSettings()).openSettings()).BubblPermissionStatus also has a const constructor with the three fields, a BubblPermissionStatus.fromMap(Map<String, Object?> map) factory for the object the native SDK sends, and a readable toString().
type BubblPermissionStatus, with string values.
'always' means geofences work with the app closed.