To ensure your React Native (Bare workflow) Android application can receive push notifications, you must include specific meta-data tags within the <application> tag of your android/app/src/main/AndroidManifest.xml file.
The following tags are required for the Pushwoosh SDK to function correctly:
com.pushwoosh.appid: Your unique application code from the Pushwoosh Control Panel.com.pushwoosh.senderid: The Sender ID from your Firebase project, which is used for Firebase Cloud Messaging (FCM).
Here is an example of how to add them to your AndroidManifest.xml:
<application ...>
...
<!-- Add these lines inside the <application> tag -->
<meta-data
android:name="com.pushwoosh.appid"
android:value="XXXXX-XXXXX" /> <!-- Replace with your Pushwoosh Application ID -->
<meta-data
android:name="com.pushwoosh.senderid"
android:value="YOUR_FCM_SENDER_ID" /> <!-- Replace with your FCM Sender ID -->
...
</application>
Additional Troubleshooting
A common reason for push notification failures on Android is an incorrectly placed google-services.json file. Ensure that you have placed this file in the correct directory: android/app/.
After adding the meta-data tags and verifying the google-services.json file location, rebuild your application to apply the changes.
Comments
0 comments
Please sign in to leave a comment.