Managed Integration
To make integrations easier the PushSDK automatically integrates itself into your application delegate and user notification center by using method swizzling. You may want to disable the automatic integration in several scenarios including:
Conflicts with other SDKs that also include swizzling or other automatic integrations
Conflicting third party development solutions
Our method swizzling conflicts with your existing architecture
We suggest that you only consider a managed integration if swizzling is incompatible with existing code. If you choose to use a managed integration you will need to ensure that any new releases to the PushSDK do not add additional methods that must be called manually.
Add the following method call before calling PushSDK.setConfiguration
:
This must be invoked before calling
PushSDK.setConfiguration(appKey: myAppKey, withLaunchOptions: launchOptions)
Once swizzling has been disabled you'll also be required to place calls to the PushSDK to invoke the methods that are no longer swizzled. If you do not implement all of the following methods the PushSDK may not function properly.
The methods you must call manually are:
application:didRegisterForRemoteNotificationsWithDeviceToken:
application:didFailToRegisterForRemoteNotificationsWithError:
application:didReceiveRemoteNotification:fetchCompletionHandler:
userNotificationCenter:willPresent:withCompletionHandler:
userNotificationCenter:didReceive:withCompletionHandler:
If you are targeting iOS version 10 or earlier:
application:didReceiveRemoteNotification:
UIApplicationDelegate Example
UNUserNotificationCenterDelegate Example
Last updated