If your Android devices are not appearing in the Pushwoosh Control Panel after you've integrated the SDK, it is typically due to a configuration issue in your project. The best first step is to check your device's console logs (Logcat) for specific error messages during the application launch.
Here are the two most common causes and their solutions:
1. Missing Firebase Messaging Dependency
Pushwoosh relies on Firebase Cloud Messaging (FCM) for push delivery on Android. If this dependency is missing, the SDK cannot initialize properly.
Symptom in Logs: You will see an IllegalStateException error in your device logs similar to this:
java.lang.IllegalStateException: You must add "implementation 'com.google.firebase:firebase-messaging:+'" line to your app build.gradle.
Solution: Add the Firebase Messaging dependency to your app-level build.gradle file (usually app/build.gradle):
dependencies {
// ... other dependencies
implementation 'com.google.firebase:firebase-messaging:+'
}
Alternatively, you can use the Firebase assistant in Android Studio to add the required dependencies automatically:
1. In Android Studio, go to Tools > Firebase.
2. In the Assistant panel, expand Cloud Messaging.
3. Click “Set up Firebase Cloud Messaging” and follow the steps to add FCM to your app.
2. Incorrect API Key Permissions
The API key used in your app must have permission to access the corresponding application in your Pushwoosh account.
Symptom in Logs: You may see 401 Unauthorized errors in your device logs when the SDK attempts to register the device with Pushwoosh servers.
Solution:
1. Go to your Pushwoosh Control Panel.
2. Navigate to the API Access section for your application.
3. Select the API key that you have configured within your application's code.
4. Ensure that the checkbox for your application is checked, granting the key access.
5. Save the changes.
After making these changes, uninstall the app from your test device, rebuild the project, and run it again. The device should now register successfully and appear in your Control Panel.
Comments
0 comments
Please sign in to leave a comment.