You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 7, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 7, 2019. It is now read-only.
Android: Not getting push notification on background #178
as far as i know if you dont send notification part in your json it wont shown when app in background.
Because default behavior for plugin when app in background is need notification part in your json.i dont know if you change this. but if you change your json like this;
{"to":"[add your token]",
"data":{"title":"Test Title","body":"Test Description"},
"notification": {
"title": "Test Title",
"text": "Test Description"
},
"priority":"high"}
@tomylee001001 is correct. But I'm sure it was working before with only sending data in both foreground and background (was using v0.1.2). Not sure if this is because the plugin uses some new version of the native libs or because some change in the plugin, but it should be noted somewhere in the readme/breaking changes for the version.
@naiveaiguy It's not working. My scenario is, I am sending following data from server
{"to":"[add your token]","data":{"title":"Test Title","body":"Test Description"},"priority":"high"} but I am not able to receive it. If I send {"to":"[add your token]","notification":{"title":"Test Title","body":"Test Description"},"priority":"high"} It is working but It shows me the notificatio. I don't want to show the notification. I wanted to pass the data silently without showing it to user.
@lini I am getting the same behavior as OP. Using data only notifications I get the notificationCallback() when my app is in the foreground or minimized and in the recent used tray. When I swipe the app away, I see that my data-notifications are cached because no callback was found . Is this the intended behavior?
When using the android sdk from firebase Quickstart demo, my messageReceivedCallback() gets called even when I swipe the app whereas when I use the NativeScript plugin it doesn't get called unless I relaunch the app.
This was tested on multiple devices (s8 API 26, pixel, Moto API 24, iPhone X and 6s) using the demo app. I have noticed this in https://github.com/EddyVerbruggen/nativescript-plugin-firebase as well. Is it not possible to replicate the behavior in the FCM Quickstart demos?
Just leaving another bump. I'm using an older GCM library for sending (I really don't want to migrate at this point in time). So no notification structure means i only get the message from within the app.
Also the message on Android is a string (json encoded) while on ios it's a json object.
Any plans to fix these or should i look into it myself or get another plugin?
Activity
lini commentedon Jan 8, 2018
Can you share some more details about this issue:
mayureshjadhav commentedon Jan 8, 2018
@lini I am sending following content
{"to":"[add your token]","data":{"title":"Test Title","body":"Test Description"},"priority":"high"}and on notification receive, I am using nativescript-local-notifications plugin to show the notification
When the app is running I am receiving the notification but when the app is not working I am not getting any notification.
I am using Moto G device with 5.1 Android version to test this functionality.
tomylee001001 commentedon Jan 9, 2018
as far as i know if you dont send notification part in your json it wont shown when app in background.
Because default behavior for plugin when app in background is need notification part in your json.i dont know if you change this. but if you change your json like this;
{"to":"[add your token]",
"data":{"title":"Test Title","body":"Test Description"},
"notification": {
"title": "Test Title",
"text": "Test Description"
},
"priority":"high"}
it should work both foreground and background
PeterStaev commentedon Jan 12, 2018
@tomylee001001 is correct. But I'm sure it was working before with only sending
datain both foreground and background (was using v0.1.2). Not sure if this is because the plugin uses some new version of the native libs or because some change in the plugin, but it should be noted somewhere in the readme/breaking changes for the version.PeterStaev commentedon Jan 12, 2018
After digging the code for another problem, seems issue came with the removal of the
NotificationBuilderclass which was pulling the title/message from thedatahttps://github.com/NativeScript/push-plugin/blob/0.1.2/native-src/android/app/src/main/java/com/telerik/pushplugin/NotificationBuilder.java#L77
https://github.com/NativeScript/push-plugin/blob/0.1.2/native-src/android/app/src/main/java/com/telerik/pushplugin/NotificationBuilder.java#L83-L88
With the removal now we have to use the
notificationstructure. Again this should have been in the Breaking Changes for v0.2 👎mayureshjadhav commentedon Jan 15, 2018
Still not working
mayureshjadhav commentedon Jan 19, 2018
Is there any updates on it?
mayureshjadhav commentedon Feb 28, 2018
@naiveaiguy It's not working. My scenario is, I am sending following data from server
{"to":"[add your token]","data":{"title":"Test Title","body":"Test Description"},"priority":"high"} but I am not able to receive it. If I send {"to":"[add your token]","notification":{"title":"Test Title","body":"Test Description"},"priority":"high"} It is working but It shows me the notificatio. I don't want to show the notification. I wanted to pass the data silently without showing it to user.
KkevinLi commentedon Jun 26, 2018
@lini I am getting the same behavior as OP. Using data only notifications I get the notificationCallback() when my app is in the foreground or minimized and in the recent used tray. When I swipe the app away, I see that my data-notifications are cached because no callback was found . Is this the intended behavior?
When using the android sdk from firebase Quickstart demo, my messageReceivedCallback() gets called even when I swipe the app whereas when I use the NativeScript plugin it doesn't get called unless I relaunch the app.
This was tested on multiple devices (s8 API 26, pixel, Moto API 24, iPhone X and 6s) using the demo app. I have noticed this in https://github.com/EddyVerbruggen/nativescript-plugin-firebase as well. Is it not possible to replicate the behavior in the FCM Quickstart demos?
michael-dots commentedon Sep 18, 2018
Just leaving another bump. I'm using an older GCM library for sending (I really don't want to migrate at this point in time). So no notification structure means i only get the message from within the app.
Also the message on Android is a string (json encoded) while on ios it's a json object.
Any plans to fix these or should i look into it myself or get another plugin?