I'm trying to use ionic.io
to send push notification. Here is what I did :
ionic.io
dashboardMy source code in app.js which generated by ionic start pushdemo
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
var push = new Ionic.Push({
"debug": true
});
push.register(function(token) {
alert(token.token);
console.log("Device token:",token.token);
push.saveToken(token);
});
7.Add push plugin:
ionic plugin add phonegap-plugin-push --variable SENDER_ID="myproject_number"
I tried both with or without quotation mark around myproject_number. It's the project number in step 1.
8.Set the dev_push to false
9.Hook my app to ionic.io by ionic io init
10.Run ionic run android -lc
Found the following error message:
What's wrong with it? Can anybody help? Thanks.
i had the same problem its generally because of proxy issue you are behind the proxy it means you are using internet by making request to the server ,so first you should use your own internet (in this case if you use WIFI then also it will work ) second aafter creating your project dirsctly make login from your cinsole to ionic io it will ake for email and password that will make your app live third
ionic plugin add phonegap-plugin-push --variable SENDER_ID="myproject_number"
use quotes for entering your project number.project number also called GCM number and your server key is the key you generated in same project means google console which enable you to use google services. and dont forget to add android platform
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With