iOS SDK 15.6.7,
Android SDK 15.5.3,
Hello Screen Dynamic States,
Bluedot Cordova plugin 4.0.1,
Bluedot Xamarin Android wrapper 15.5.2,
Bluedot Xamarin iOS wrapper 15.6.6,
Bluedot React Native wrapper 2.3.0,
This documentation depends on BluedotPointSDK and Appboy-iOS-SDK. Both dependencies can be managed by CocoaPods.
You can find detailed instructions at https://docs.bluedot.io/ios-sdk/ios-quick-start
import BDPointSDK
BDPGeoTriggeringEventDelegate
:
// Swift extension YourClass: BDPGeoTriggeringEventDelegate { func didEnterZone(_ enterEvent: BDZoneEntryEvent) { // Your logic when the device enters a Bluedot Zone } func didExitZone(_ exitEvent: BDZoneExitEvent) { // Your logic when the device leaves a Bluedot Zone } }
// Swift let instanceOfYourClass = YourClass() BDLocationManager.instance()?.geoTriggeringEventDelegate = instanceOfYourClass
// Swift BDLocationManager.instance()?.initialize(withProjectId: projectId){ error in guard error == nil else { print("There was an error initializing the Bluedot SDK: \(error.localizedDescription)") return } }
Import Appboy-iOS-SDK to your class
// Swift import Appboy_iOS_SDK
Start Appboy-iOS-SDK within the application:didFinishLaunchingWithOptions
method.
For further information refer to Braze Developer Documentation
// Swift Appboy.start(withApiKey: "Your assigned Braze API Key", in: application, withLaunchOptions: launchOptions)
Track Braze custom events in your Bluedot Entry / Exit events.
func didEnterZone(_ enterEvent: BDZoneEntryEvent) { // Name the custom event let customEventName = "bluedot_entry" // Map the Location and Bluedot Zone attributes into a properties dictionary var properties = [ "zone_id": "\(enterEvent.zone().id!)", "zone_name": "\(enterEvent.zone().name!)", "latitude": "\(enterEvent.location.latitude)", "longitude": "\(enterEvent.location.longitude)", "speed": "\(enterEvent.location.speed)", "bearing": "\(enterEvent.location.bearing)", "timestamp": "\(enterEvent.location.timestamp!)" ] // Map the Custom Data attributes into properties if let customData = enterEvent.zone().customData, !customData.isEmpty { customData.forEach { data in properties["\(data.key)"] = "\(data.value)"} } // Log the Custom Event in Appboy Appboy.sharedInstance()?.logCustomEvent(customEventName, withProperties: properties ) } func didCheckOut(_ exitEvent: BDZoneExitEvent) { // Name the custom event let customEventName = "bluedot_exit" // Map the Zone attributes into a properties dictionary var properties = [ "zone_id": "\(exitEvent.zone().id!)", "zone_name": "\(exitEvent.zone().name!)", "timestamp": "\(exitEvent.date)", "checkedInDuration": "\(exitEvent.duration)" ] // Map the Custom Data attributes into properties if let customData = exitEvent.zone().customData, !customData.isEmpty { customData.forEach { data in properties["\(data.key)"] = "\(data.value)"} } // Log the Custom Event in Appboy Appboy.sharedInstance()?.logCustomEvent(customEventName, withProperties: properties ); }