If your iOS application is not reporting push notification open statistics, it is often due to an incorrect configuration or implementation of the Notification Service Extension (NSE). The NSE is essential for tracking rich media, delivery statistics, and open rates.
Follow these steps to troubleshoot and resolve the issue:
1. Verify Your Notification Service Extension Code
Your NotificationService.swift (or equivalent Objective-C) file should be as minimal as possible to allow the Pushwoosh SDK to handle the notification. Custom code can interfere with the tracking process. Ensure your code matches the following example for Swift:
import UserNotifications
import PushwooshFramework
class NotificationService: UNNotificationServiceExtension {
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
PWNotificationExtensionManager.shared().handle(request, contentHandler: contentHandler)
}
}
Note: For older versions of the Pushwoosh SDK, you might need to import Pushwoosh instead of PushwooshFramework.
2. Check the NSE Target Configuration
It is crucial that the Notification Service Extension target itself is configured correctly in Xcode.
-
Check the
info.plistfile: Theinfo.plistfile associated with your NSE target (not your main app target) must contain your Pushwoosh Application ID. Add the following key and string value:<key>Pushwoosh_APPID</key> <string>XXXXX-XXXXX</string>Replace
XXXXX-XXXXXwith your actual Pushwoosh Application Code. Verify Frameworks: Ensure that
PushwooshFramework.xcframeworkis included in the Frameworks, Libraries, and Embedded Content section of your NSE target settings.
3. Re-create the Notification Service Extension
If you have verified the steps above and statistics are still not being tracked, your project configuration may have an issue. Try removing the Notification Service Extension target completely from your Xcode project and then adding it again, carefully following the steps in our official iOS SDK integration guide.
Comments
0 comments
Please sign in to leave a comment.