ion trigger pushCall ion login ion loading
// open the Google console 1-create a project 2-go google api 1-mobile APIs 2-select Google Cloud messaging and trick it 3- go to credentials and create an API key
// after that add the following plugin
ionic add-on ion-platform-web client ionic plug-in add phonegap-plugin-push -variable SENDER_ID = "991785317333" (do not remove quotes when adding gcm number)
// add platfom
ion platform add android ion io init ion config dev_push true
// open ion io go to setup 1-create api key
2-go to the certificate and create the name of the security profile profile, click on the android and add the GCM key and save it.
//add this code to app.js angular.module('starter', ['ionic']) .run(function($ionicPlatform) { $ionicPlatform.ready(function() { var push = new Ionic.Push({ "debug": true }); push.register(function(token) { console.log("My Device token:",token.token); push.saveToken(token); // persist the token in the Ionic Platform }); }); })
// check if your mail is configured correctly with an open mail server open source // and then do the following:
1-create collection give it a valid name 2-in body click on text and select Application/json it will add header automatically 3-add another header key as Authorization value as bearer followed by your api token from ionic io 4-select "raw " as the format of our json 2-in body section of your collection write following code { "tokens": ["DEV_DEVICE_TOKEN"], "profile": "PROFILE_NAME", "notification": { "message": "This is my demo push!" } }
// now it will call a message in the browser
gcm_key ion configuration set
Ionic configuration dev_push false ion compilation android
install the application on your mobile and send a notification from the postman
(Mahesh Sampat Nigut) navi mumbai
source share