Activate logging when troubleshooting
You can activate WonderPush logs by simply calling
WonderPush.setLogging(true)
.Our logs report pretty much the entire activity of our SDK. They are all prefixed with
[WonderPush]
so they're easy to filter in and out.Don't forget to turn them off in your release build.
Supported configurations for push notifications
Device | Distribution mode | Push certificate environment |
---|---|---|
Simulator | Not supported | |
Physical device | Xcode | Sandbox / development |
Physical device | TestFlight | Production |
Physical device | In-house / Enterprise | Production |
Physical device | AppStore | Production |
Push certificate
Creating or renewing an iOS Push certificate
Follow this comprehensive article from Apple Developer Account Help: Communicate with APNs using a TLS certificate.
Notification display issues
Notifications not shown at all
When a notification is received, WonderPush will add log entries. You can tell when a notification is received by searching the string
userInfo
in WonderPush logs.
If your device is connected to the Internet via an enterprise network, chances are you are behind a Firewall. Apple push notification service, the technology behind iOS push notifications, requires ports 5223
, on IPs 17.0.0.0/8
to be open for notifications to be delivered.
If the notification is received but not displayed:
- make sure it isn't a silent notification,
- make sure its
Text
field isn't empty, - make sure its payload's
aps.alert.body
property has a value.
If the notification is not received and the logs are empty:
- make sure you have a valid push certificate,
- if you are deploying via Xcode, make sure the push certificate is valid for the sandbox environment,
- if you are deploying a production build, make sure the push certificate is valid for the production environment,
- find your
installationId
in the logs and make sure it is part of your notification target, - finally, make sure your notification get sent by observing its number of Notifications sent on the notification detail page.
If you are still experiencing issues, please let us know by chatting with us.
Notification has no Image
- Verify the URL of the image by opening it in a web browser. The image should be displayed.
- Make sure the URL is a direct link to the image, not an HTML page.
- Make sure the URL of the image is HTTPS. If the URL is HTTP, make sure it is allowed by App Transport Security.
- Make sure there is no redirect by pasting the URL in a web browser and verifying the URL doesn't change when the image is displayed.
- Make sure you've correctly added the Notification Service Extension as described in the quickstart guide
- Make sure the Notification Service Extension's Deployment target is
iOS 10.0
.
Video content is not playing
Check every item of the Notification has no image section as if your video was an image. In addition, also check the following:
- Make sure your video content is within the iOS size limitations.
- Make sure your video format is supported by iOS by opening the URL of your video in Safari on an iOS device.
Xcode errors
Automatic signing and provisioning profile errors
If you're getting the following error, make sure to set up Automatic Signing for the extension:
Provisioning profile "XXX" has app ID "YYY", which does not match the bundle ID "YYY.WonderPushNotificationServiceExtension".
If you use a framework and CI/CD automated build tools, make sure to check your framework's solution for automatically setting provisioning.
After installing Xcode 10.3 I get "Failed to find or create execution context for description..."
You just installed Xcode 10.3 and you get a build error similar to:
Failed to find or create execution context for description <IBCocoaTouchPlatformToolDescription: 0x7fa8bad9a6f0>
This worked for us:
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService
See this stackoverflow answer.
When I run my app, I get this warning: Class WP[...] is implemented in both [...]WonderPushExtension.framework[...] and [...]WonderPush.framework[...]. One of the two will be used. Which one is undefined.
Class WP[...] is implemented in both [...]WonderPushExtension.framework[...] and [...]WonderPush.framework[...]. One of the two will be used. Which one is undefined.
This runtime warning is harmless. It is due to a known CocoaPods issue that results in the main app target being linked against all pods, including those of the notification service extension.
You can safely ignore this warning, but if you want to remove the annoying log messages, here are a few options:
-
In Xcode, find the
Pods-MyApp.debug.xcconfig
andPods-MyApp.release.xcconfig
files inside thePods
project in theTargets Support Files/Pods-MyApp
directory (replaceMyApp
with your app name). Edit both files to remove-framework "WonderPushExtension"
from theOTHER_LDFLAGS
setting. This will make the warning go away, but this modification will not survive thepod install
command. -
You can also move away from CocoaPods and use another installation method for WonderPush. We support Carthage Integration and Manual iOS Integration.
Debugging the notification extension
To debug the notification extension:
- Activate logging in the notification extension by adding the following code to the
NotificationService
class you've created in the quickstart guide:
func loggingEnabled() -> Bool {
return true
}
- (BOOL) loggingEnabled {
return YES;
}
- Open the logging console in Xcode under Window > "Devices and Simulators". Select your device on the left and open the log up arrow at the bottom.
- Send yourself a notification and look for the string
didReceiveNotificationRequest
in your device logs.
We do not recommend attaching the debugger to the notification extension, as this can cause the extension to stop working entirely. When this happens, you need to reboot your iOS device.
Updated about a month ago