Notifications to android and iOS

What if you want to send notifications to your Android and iOS versions of your app? I know how to do this with the help of Firebase, because of their clear documentation and examples. But it would be cool to send to Android too from the Vapor server. Any hints or tips were to look?
HJ Hubeek

I’m not familiar with Android, sorry. I did a quick google search and found this: Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID · GitHub which shows a PHP solution very similar to the iOS one.

What I would suggest is add another column to the Vapor model which identifies whether the token is for iOS or Android, and then in the PHP scripts you’d query just against the specific type you were interested in.

1 Like

Looks like a link to a gcm service. Thats deprecated now… and replaced by firebase… looks like i need to google some more;-)