0

I'm trying to build one app in NativeScript which involves push notifications.I followed the tutorial in https://bradmartin.net/2015/12/28/use-google-cloud-messaging-for-push-notifications-with-nativescript/.

But push notifications are not showing in notification bar.I tried to print the message in console, it is printing what I'm sending through postman.

Any suggestion will be helpful.

Thanks.

Karteek
  • 138
  • 2
  • 14
  • 1
    Try uninstalling the app from device, then install a new build. Then try the push. If that fails, close the app out (kill it from running) and try. Let me know what happens. – Brad Martin May 01 '16 at 13:28
  • A million thanks to you.After uninstall and install the new build it did't worked, but I closed the app and then tried it's working(When app is not running).After that every time I'm able to see the notifications.Thanks again. But I have one doubt.I gave **onMessageReceived** function in "registration" page.So If I'm in "registration" page I'm getting notifications.If I'm in some other page then push notifications are not showing in notification bar.Can you give me some suggestion please..!!! – Karteek May 02 '16 at 01:00
  • Try moving that function to the app level. This might help: http://stackoverflow.com/questions/31502225/adding-a-global-variable-function-in-javascript-specifically-nativescript This also might help if you need to run something on some events: https://github.com/NathanaelA/nativescript-globalevents – Brad Martin May 02 '16 at 04:57
  • Actually push message content is printing in console, but not displaying in notification bar if I'm in different page.If I'm closing the app then it is showing in notification bar. – Karteek May 02 '16 at 12:40
  • Even after moving onMessageReceived function to the app level, if app is closed then onMessageReceived function is not executing.Any suggestions?? – Karteek May 07 '16 at 23:46

0 Answers0