Step by Step Guide for adding Pushe to Cordova/Ionic applications
This sample is created with Cordova CLI, but the guildeline and plugin is for both Cordova and Ionic.
- Create your app with cordova or ionic and add Android platform to it.
- Download Pushe plugin for ordova/Ionic from this link.
- Unzip Pushe Cordova/Ionic that you have downloaded. Open
cordova-plugin-1.0.0/plugin.xmlfile and replace PUSHE_TOKEN with your token. You can obtain your token from your panel on http://panel.pushe.co, under the application you have created for your Cordova/Ionic app.
Run below command to add plugin to your app. If you use Cordova:
cordova plugin add [path-to-downloaded-plugin]
And if you are using ionic:
ionic plugin add [path-to-downloaded-plugin]
Open index.html file of your app and add below script to it:
Pushe requires google-gcm library. Our current cordova plugin is set to use
gms:play-services-gcm:9.4.0. If you have newer or older version of gcm, please edit
cordova-plugin-1.0.0/plugin.xml and change version number in
<framework src="com.google.android.gms:play-services-gcm:9.4.0"/> line to your version number (like 9.6.0). Please note taht you can NOT use gcm version lower than
Now you can
Run your project on your device and test it.
- Pushe supports minimum android sdk=9. But Ionic (in its recent versions) uses minimum sdk=14 for android applications. So becareful about it.
support [at] pushe.co
+98-21-44668276 (8:00 to 17:00 Sat-Thu)