When the Pushwoosh React Native plugin runs alongside another push library (for example @react-native-community/push-notification-ios) in the same iOS app, both may try to own UNUserNotificationCenterDelegate. The symptoms are local notifications not firing, push tokens not registering, or opens not being tracked.
Preferred fix: register your delegate with Pushwoosh
The Pushwoosh iOS SDK 7.x lets other components keep receiving notification callbacks while Pushwoosh keeps its automatic delegate proxy:
Pushwoosh.configure.addNotificationCenterDelegate(self)
Use PWMessage.isPushwooshMessage(_:) in your own delegate to tell Pushwoosh notifications apart from your own and handle only the non-Pushwoosh ones.
Alternative: take over the delegate yourself
If the other library must own the delegate, opt out of Pushwoosh’s automatic proxy by adding this to Info.plist:
<key>Pushwoosh_PLUGIN_NOTIFICATION_HANDLER</key>
<true/>
This flag alone is not enough. It tells the SDK that notification handling is implemented by the plugin/host app, so you must forward the events to Pushwoosh yourself from your own delegate, otherwise push parsing, open tracking, deep links and notification actions will stop working:
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification,
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
Pushwoosh.configure.handleWillPresentNotification(notification, completionHandler: completionHandler)
}
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void) {
Pushwoosh.configure.handleNotificationResponse(response, completionHandler: completionHandler)
}
Pushwoosh calls the completion handler for you — do not call it again. These forwarding methods only have an effect while the opt-out flag is set; with the automatic proxy active they are ignored and a warning is logged.
Note for Android
Multiple push providers on Android can also interfere with each other’s FirebaseMessagingService. You can control this by setting service priorities in AndroidManifest.xml — see our guide on handling multiple FCM services.
Comments
0 comments
Please sign in to leave a comment.