Catapush PhoneGap / Cordova / Ionic Library
Demo implementation of the Catapush messaging on a Phonegap / Cordova application.
Follow this steps to setup your first Cordova app (similar steps for a Ionic app). You should have nodejs and npm installed.
npm install -g cordova
Setup a new project:
cordova create catapush com.company.app DemoApp
Install required plugins:
cd cordova cordova plugin add cordova-plugin-device cordova plugin add https://github.com/Catapush/phonegap-plugin-push.git --variable SENDER_ID="XXXXXXX" (in alternative to cordova plugin add phonegap-plugin-push) cordova plugin add cordova-plugin-x-toast cordova plugin add cordova-plugin-file cordova plugin add cordova-plugin-file-opener2
Download the project and replace the www folder to use it as a boilerplate.
Follow Cordova instructions to add platforms and build the project.
- To support ios 6, install following version of phonegap-plugin-push and cordova:
cordova platform add email@example.com cordova plugin add firstname.lastname@example.org --variable SENDER_ID="XXXXXXX"
Official Phonegap Push Plugin currently has a bug with Android devices which prevents app restart when a push notification is received if the app has been closed manually. There is a pending pull request that can be used to patch the bug until it is merged or even better use the Catapush phonegap-plugin-push repository. Please remember to change MainActivity.java as suggested in the documentation.
Follow these instructions to setup push notification in your Catapush App Dashboard
Try adding an old android platform if you have problems:
cordova platform add email@example.com