Hi. I have problems with push notificacions and I need help, please.
I declare without problems:
ionic add ionic-platform-web-client
ionic plugin add phonegap-plugin-push
ionic io init
ionic config set dev_push true
Later, in Ionic page, I take my ID application and my Secret API.
Later, in google developer console, I create the API for Google Cloud Messaging (Server), and I take my Project ID and my Project Name.
Later, I declare without problems:
ionic push --google-api-key your-google-api-key
ionic config set gcm_key
Finally, inside
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
I use this code:
var push = new Ionic.Push({
“debug”: true
});
push.register(function(token) {
console.log("Device token:",token.token);
});
Ionic.io();
var user = Ionic.User.current();
if (!user.id) {
user.id = Ionic.User.anonymousId();
}
user.save();
I can compile the aplication and I can install in the mobile without problems but the notificacions doesn’t work.
What am I doing wrong?
Thanks!!!