Migration guide from 1.1 to 1.2¶
This guide will help you migrate from the 1.1 version to the 1.2.
Requirements¶
iOS minimum version¶
Numberly 1.2 requires iOS 10.0 or higher.
XCode version¶
Numberly 1.2 requires XCode 12 or higher.
Setup Instructions¶
Starting from this 1.2, the iOS SDK is a distributed as standard xcframework.
1. Remove previous integration¶
- Remove the
NumberlyCore.frameworkandNumberlyPush.frameworkfrom your project. When asked what to do with the deletion, pickMove To Trash. - Xcode will automatically removed them from the
Link Binary With LibrariesandEmbed Frameworksbuild steps. - From your app's target
Build Phases, find theRun Scriptwhich contains the following snippet and delete itbash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Numberly.framework/strip-frameworks.sh"
Grea! Let's install the 1.2 version.
2. Install the new version¶
The 1.2 version can be installed using CocoaPods or manually. Please follow the installation guide before continuing the migration.
3. Add the configuration file¶
Add the Numberly.plist as explained here.
Important
You should set both automatic_integration and automatic_notification_registration properties to false.
4. Start the SDK¶
As from the 1.2 version, Numberly SDK must be started in the AppDelegate's application:didFinishLaunchingWithOptions: method:
import Numberly
func application(_ application: UIApplication,
didFinishLaunchingWithOptions
launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Numberly.start()
...
}
@import Numberly;
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[Numberly start];
...
}
Push Notifications¶
Enabling Push Notifications¶
The registerForRemoteNotifications: method signature has changed. Now it has a completionHandler. The completionHandler is nullable and the default value is nil. If your app is in Swift no change is needed. But if you are using Objective-C you should update the call:
[Numberly.push registerForRemoteNotifications:@[@(NBLPushAuthorizationOptionAlert),
@(NBLPushAuthorizationOptionSound),
@(NBLPushAuthorizationOptionBadge)]
completionHandler:^(BOOL granted) {
//
}];