Wave API,
Android SDK version 15.3.2,
iOS SDK version 15.4.1 &
Canvas & Config API 1.2.0
released.
Details here.
Braze iOS Integration
Table of Contents
Getting started
This documentation depends on BluedotPointSDK and Appboy-iOS-SDK. Both dependencies can be managed by CocoaPods.
Integrate your project with Bluedot Point SDK
You can find detailed instructions at https://docs.bluedot.io/ios-sdk/ios-integrating-the-sdk/
- Implement BluedotPointSDKimport BDPointSDK to your class:
import BDPointSDK
- Implement Bluedot location delegate:
// Swift class YourClass: BDPLocationDelegate { func didCheck( intoFence fence: BDFenceInfo!, inZone zoneInfo: BDZoneInfo!, willCheckOut: Bool, withCustomData customData: [AnyHashable : Any]! ) { // Your logic when the device enters a Bluedot Zone } func didCheckOut( fromFence fence: BDFenceInfo!, inZone zoneInfo: BDZoneInfo!, on date: Date!, withDuration checkedInDuration: UInt, withCustomData customData: [AnyHashable : Any]! ) { // Your logic when the device leaves a Bluedot Zone } }
- Assign location delegate with your implementation
// Swift let instanceOfYourClass = YourClass() BDLocationManager.instance()?.locationDelegate = instanceOfYourClass
- Authenticate with the Bluedot services
// Swift BDLocationManager.instance()?.authenticate(withApiKey: "Your assigned Bluedot API Key", requestAuthorization: .authorizedAlways)
Integrate your project with Appboy SDK
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 didCheck( intoFence fence: BDFenceInfo!, inZone zoneInfo: BDZoneInfo!, atLocation location: BDLocationInfo!, willCheckOut: Bool, withCustomData customData: [AnyHashable : Any]! ) { // Name the custom event let customEventName = "bluedot_entry" // Map the Location and Bluedot Zone attributes into a properties dictionary var properties = [ "zone_id": "\(zoneInfo.id!)", "zone_name": "\(zoneInfo.name!)", "latitude": "\(location.latitude)", "longitude": "\(location.longitude)", "speed": "\(location.speed)", "bearing": "\(location.bearing)", "timestamp": "\(location.timestamp!)", ] // Map the Custom Data attributes into properties if customData != nil && !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( fromFence fence: BDFenceInfo!, inZone zoneInfo: BDZoneInfo!, on date: Date!, withDuration checkedInDuration: UInt, withCustomData customData: [AnyHashable : Any]! ) { // Name the custom event let customEventName = "bluedot_exit" // Map the Zone attributes into a properties dictionary var properties = [ "zone_id": "\(zoneInfo.id!)", "zone_name": "\(zoneInfo.name!)", "timestamp": "\(date!)", "checkedInDuration": "\(checkedInDuration)" ] // Map the Custom Data attributes into properties if customData != nil && !customData.isEmpty { customData.forEach { data in properties["\(data.key)"] = "\(data.value)"} } // Log the Custom Event in Appboy Appboy.sharedInstance()?.logCustomEvent(customEventName, withProperties: properties ); }
Created by Daniel Toro on August 6, 2019