Troubleshooting tips
Resolve common issues with Firebase settings, dependencies, and SDK integration.
Read time 3 minutesLast updated 18 hours ago
The following are common troubleshooting tips to follow if you encounter any issues or errors using the Push Notifications SDK. Some of the troubleshooting tips may make reference to specific common errors. However, even if you don't encounter these issues, it's still recommended to go through them in order.
1. (Android) Verify your Firebase values inside the Push Notifications settings
If you encounter issues while attempting to register your test device to Firebase while using the Push Notification SDK, it's likely that your Firebase values are either empty or invalid. You can check how to add your Firebase details in the Push Notifications Settings segment. Alternatively, if you're sure that the values you provided are correct, check there's no whitespace/space after your values. This has been known to cause issues.2. (EDM4U/MDR) Verify that the dependencies for the Push Notifications SDK have been resolved
As noted in the External Dependency Manager for Unity (EDM4U) support section, the Push Notifications SDK doesn't require or bundle the External Dependency Manager for Unity (EDM4U) or the Mobile Dependency Resolver (MDR) to resolve its own dependencies. However, if either is used, the Push Notifications SDK integrates with them.
If you don't require EDM4U or MDR for any other packages, it's recommended you uninstall them.
Otherwise, we recommend you follow these steps:
- Verify that the dependency file has been generated. Place this under the auto-generated
PushSDKDependencies.xmldirectory.Assets/Push Notifications/Editor/Android- If the file isn't present, re-open your Unity project. The file should be generated as part of this process.
- Use the or
Resolveoptions, both found under Assets > External Dependency Manager > Android Manager.Force Resolve - Verify that the Push Notifications SDK's dependencies have been resolved by using the option, also found under Assets > External Dependency Manager > Android Manager. The following line should appear:
Display Librariesimplementation 'com.google.firebase:firebase-messaging-ktx:22.0.0' // Assets/Push Notifications/Editor/Android/PushSDKDependencies.xml:9- Note that the comment besides the above line might be slightly different if other packages or SDKs make use of the same dependency.
3. (Android) Check that Minify isn't excluding the Push Notifications SDK during the build process
If you've gone through the EDM4U / MDR troubleshooting section and still receive something similar to the following error:check your Minify options under Player Settings > Publishing > Minify. If thejava.lang.ClassNotFoundException: com.unity.services.pushnotifications.android.UnityCallbackClass
ReleaseDebugCustom Proguard FileThis should resolve the issue.-keep class com.unity.services.pushnotifications** { *;}
4. (iOS) Ensure remote notifications are enabled in XCODE
For iOS apps to be able to receive Push Notifications,Remote NotificationsGo to Signing & Capabilities > Capability > Background Modes > Remote Notifications to provideFailed to register for remote notifications: no valid “aps-environment” entitlement string found for application
Remote Notifications5. Check your API keys in the Unity Dashboard under Push Notifications settings
To send Push Notifications to end-user devices, add your Google and Apple keys to the Unity Dashboard insideSettingsSandboxTrueFalse
Check your keys work by using the testing guide.