Loading...

Mobile application with push notifications

Cordova

To enable push notifications in the mobile application you need to create an account in Firebase, for this example we'll use Plaspy basic mobile application and add push notifications through Firebase
To enable push notifications in the mobile application you need to create an account in Firebase https://firebase.google.com/
After building the basic mobile application based on Cordova


To test that the Plaspy plugin works correctly we can do it at the URL https://m.plaspy.com/m/MobileAppTest/Index?pumvcv=5 from the mobile application to do this we change in the config.xml file the previous line of content to
<content src="https://m.plaspy.com/m/MobileAppTest/Index?pumvcv=5" />

To activate the Push notifications in Plaspy, go to the Settings under "Advanced Customization", "Mobile Push Notifications" and copy the private key generated by Firebase. In Firebase Account key, copy the content of the JSON file containing the private key.
To get our private key for sending Push Notifications in Firebase we follow the instructions of https://firebase.google.com/docs/admin/setup#initialize_the_sdk
To test that the key works properly we can use the token of our test device (Push notifications only work on a device and not on the emulator)
https://firebase.google.com/docs/cloud-messaging/android/client#sample-register
https://firebase.google.com/docs/cloud-messaging/ios/client#fetching-the-current-registration-token