If you are not seeing statistics for push notification sends and opens for your iOS application, the issue is most likely related to an incorrect configuration of the Notification Service Extension (NSE). The NSE is responsible for processing incoming notifications and tracking these statistics before the notification is displayed to the user.
Follow these steps to troubleshoot and resolve the issue:
1. Verify Your NotificationService.swift Implementation
Your NotificationService.swift file should contain only the code required to pass the notification request to the Pushwoosh SDK. Any additional custom code within the didReceive function can interfere with statistics tracking.
Ensure your implementation is minimal and correct. For recent SDK versions, it should look like this:
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 use import Pushwoosh instead of import PushwooshFramework. Please refer to the integration guide for your specific SDK version.
2. Check Your Target Configurations (info.plist)
It is crucial that both your main application target and your Notification Service Extension target are configured correctly in Xcode.
For your Notification Service Extension target:
- Ensure its
info.plistfile contains yourPushwoosh_APPID. Without this, the extension cannot link statistics to your application.<key>Pushwoosh_APPID</key> <string>XXXXX-XXXXX</string>
- Ensure its
For your main app target:
- Verify that its
info.plistalso contains yourPushwoosh_APPID.
- Verify that its
App Groups:
- Verify that you have enabled App Groups for both your main app target and your NSE target in Xcode under the "Signing & Capabilities" tab.
- The App Group identifier (e.g.,
group.com.example.appname) must be identical for both targets.
3. Re-add the Notification Service Extension
If you have verified the steps above and statistics are still not being collected, there may be a configuration issue within your Xcode project. Try removing the Notification Service Extension target completely and then adding it again, following the Pushwoosh integration documentation carefully. This can often resolve underlying project setting conflicts.
Comments
0 comments
Please sign in to leave a comment.