This migration guide is for users that are moving from OpenBack's iOS SDK V1 to
<=V4.0.0. You can update to the latest version of OpenBack with the code below.
After updating, the steps for migrating are as follows:
- Remove the
openback.jsonfile and switch to our latest
- Use the latest API calls from V4.
- Add in the background modes for iOS 13+.
1 - plist Configuration
- Remove the
openback.jsonas this is no longer needed in V4.
- You can now configure OpenBack in your application Info.plist using the
OpenBackdictionary or in its own plist file named
Available configuration keys:
|AppCode||-||The OpenBack app code for your application|
|AppGroup||-||The app group used for OpenBack and notification app extenstions|
|DebugLevel1||0||The debug log level - see debug levels|
|EnableAutoStart2||true||Controls if OpenBack starts automatically|
|ClearBadgeCount5||false||Controls if OpenBack clears the badge number when app is opened (only if badge is enabled)|
|EnableCoreMotionActivity||false||Controls if library can use Core Motion Activity manager.|
|EnableMicrophone||false||Controls if OpenBack can use the microphone (Noise signal)|
|EnableProximity3||false||Controls if OpenBack can use the proximity sensor (Proximity signal)|
|EnableSwizzle4||true||Controls if swizzle is enabled|
|LargeIcon||-||Default large icon for notification (filename in main bundle or image asset name)|
|NotificationSound||-||Set the default notification sound (filename in main bundle)|
- : Using the debug level in the plist during development can be useful to get startup logs that might occur before you have a chance to call the API.
- : If you disable auto-start, you will need to manually call `+ start:` in your application.
- : Enabling proximity on iOS has the side effect of turning the screen off when the device is close to the face.
- : If you disable delegate swizzling, you will need to manually call OpenBack functions. See below for more details.
- : If you enable clearing the badge count on app launch, the SDK will set the badge count to 0 but keep the notifications in the notification center. This is done by setting the `applicationIconBadgeNumber` to -1. Setting a value of 0 would have the side effect of removing all the delivered notifications.
Alternatively, if you do not provide an App Code in the plist, you can set it manually using the API.
2 - Update Your API Calls
The iOS SDK API has been updated to match the naming scheme of our Android API for ease of use across both platforms. Our iOS API calls no longer return errors as the errors are now logged in the console. The following API calls have been changed in V4:
- setUserInfo -> setAttributes
- triggerEvent:withDelay -> signalEvent
- setCustomTrigger -> setCustomSegment
You no longer need to call the OpenBack Config as the configuration is completed in the plist.
3 - Project Configuration
In line with Apple's specifications, the OpenBack iOS V4 SDK has been split into several different modules depending on the required permissions. See below for the list of which modules you will need to include for certain signals:
- Location Signal requires that you add the OpenBackLocation framework.
- Activity Signal requires that you add the OpenBackMotion framework, but the OpenBackLocation can work too.
- Bluetooth/Connectivity Signal requires that you add the OpenBackBluetooth framework.
iOS13+ Background Modes
Check Background fetch, Background processing and Remote notifications.
When background processing is enabled, add the following two permitted tasks to the
You're now ready to use V4 of the OpenBack SDK, see our full API documentation here or look at some of our other features below.
|Signals & Permissions||Add the required settings and permissions in your project settings for signals.|
|Attributes||Attribute values can be set client side by your mobile app, and then used as personalized content within messages.|
|Custom Segments||Custom Segments are set client side by your mobile app. They can be used to deliver a message based on the value set in your message campaign which is managed through the OpenBack Dashboard or Client APIs.|
|Goals||Goals can range from anything such as a user completing a signup process, to a user purchasing a product.|
|Events||An event is an action at a particular moment in time for each user, which can then be used to deliver a notification. You can easily pass existing or new events to the OpenBack SDK client side, making advanced campaigns simple.|
|App Inbox||Deliver & manage messages in an inbox within your app – standalone, or as part of a notification.|
|Topics||Message users that are subscribed to specific topics.|
|Advanced Configuration||Advanced OpenBack configuration parameters.|
|Notifications||Customize the appearance of OpenBack notifications.|