cloud messaging not getting the message from firebase
See original GitHub issuei am using nativescript firebase and when i push message from firebase console then message is not received on android app .
but when i use
curl -X POST --header "Authorization: key=SERVER_KEY" --Header "Content-Type: application/json" https://fcm.googleapis.com/fcm/send -d "{\"notification\":{\"title\": \"My title\", \"text\": \"My text\", \"badge\": \"1\", \"sound\": \"default\"}, \"data\":{\"foo\":\"bar\"}, \"priority\": \"High\", \"to\": \"DEVICE_TOKEN\"}"
then i will receive the message on my app
i have provided the same server_key and device_token on google-services.json but its only working on local side not with the firebase web app
may be this issue is related to https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/1039
Issue Analytics
- State:
- Created 5 years ago
- Comments:9
Top GitHub Comments
the file must be in:
app/App_Resources/Android/src/main/res/values/strings.xml
after including the channel id, your strings.xml should look like this:
after saving the change, run:
tns platform remove android tns run android
I had this problem, I believe it is related to the notification channel that api 26 should be configured for users to receive the notifications, follow the steps to have the problem solved.
put this in your strings.xml
<string name="default_notification_channel_id" translatable="false">default</string>
put this in your AndroidManifest.xml
<application …>
<meta-data android:name="com.google.firebase.messaging.default_notification_channel_id" android:value="@string/default_notification_channel_id"/>
… </ application>more https://medium.com/globallogic-latinoamerica-mobile/firebase-cloud-messaging-warning-updating-to-android-oreo-1343fe894bd5