The Urban Airship Gimbal Adapter is a drop-in class that allows users to integrate Gimbal place events with Urban Airship.
Before installing the Gimbal Adapter, make sure the following dependencies are installed for you application:
- Urban Airship SDK 8.0.0 or newer
- Gimbal SDK 2.0.0 or newer
-
Copy
GimbalAdapter.swift
into your project -
In your application delegate, call restore during didFinishLaunchingWithOptions:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
GimbalAdapter.shared.restore()
...
}
Restore will automatically resume the adapter on application launch.
To start the adapter call:
GimbalAdapter.shared.start("## PLACE YOUR API KEY HERE ##")
Adapter can be stopped at anytime by calling:
GimbalAdapter.shared.stop()
In the event that Bluetooth is disabled during place monitoring, the Gimbal Adapter can prompt users with an alert view to enable Bluetooth. This functionality is disabled by default, but can be enabled by setting GimbalAdapter's bluetoothPoweredOffAlertEnabled property to true:
GimbalAdapter.shared.bluetoothPoweredOffAlertEnabled = true
- Copy
UAGimbalAdapter.h
andUAGimbalAdapter.m
into your project
To start the adapter call:
[[UAGimbalAdapter shared] startWithGimbalAPiKey:@"## PLACE YOUR API KEY HERE ##"];
The adapter will automatically resume itself on next application launch. You only need to call start once.
Adapter can be stopped at anytime by calling:
[[UAGimbalAdapter shared] stop];
In the event that Bluetooth is disabled during place monitoring, the Gimbal Adapter can prompt users with an alert view to enable Bluetooth. This functionality is disabled by default, but can be enabled by setting GimbalAdapter's bluetoothPoweredOffAlertEnabled property to YES:
[UAGimbalAdapter shared].bluetoothPoweredOffAlertEnabled = YES;