Push Notification example end-to-end


#1

Hi all,

I’ve wracked my brain trying to get something proper working. I have a {N} Core app, with PHP backend and need to bring in Push Notifications. I have the following requirement and questions.

  • Does anyone have a working example for me on the PHP as well as Nativescript client app side?
  • I need to know how to set it up on the Push provider’s site too,
  • Which Push provider is best to use?
  • Which Push plugin is best/easiets to use?
  • How to I pass context into the page once notification is clicked on? (example: view order #763263)
  • How do I navigate to the correct page once notification is clicked on?

There are many articles focusing on various small segments, but I suspect others may have the same requirement as this. I’m not an expert and thus need some guidance, everything from:

  • registering the device for PN
  • PHP server events that trigger the push
  • {N} client-side how to handle the notification
  • As well as setting it up in APNS and FCM, or just FCM etc (this is the part where my head really hurts)

If any body has implemented something like this before, please share the code with me so I can give it a try.

Thanks!

Nick


#2

The simple and best way could be firebase, the plugin docs has everything you need to know about integration.


#3

You talking about the nativescript firebase plugin? Does it cover the PHP part of the backend? Or you talking about a PHP plugin on Firebase?


#4

Refer official Firebase docs for that, you can use simple HTTP / CURL apis to communicate with Firebase APIs. There are even unofficial firebase clients for PHP, you may try them.


#5

Will check it out and ask questions when I have them.