First you should activate GCM service for your project in your google dev console.
After that you can register a device and the device will get the notification.
Are you using some services, that sends the notifications for your?
I implemented APN and GCM with nodejs for my apps.
In that cases you need to connect with your apiKey to gcm service and send it to your device.
Does your device gets the notification or does simply your “In-App”-Handling of the notification is not working.
I’ll try to explain more, I activate the GCM service and in my app I’ve been able to register to this service with the App ID.
But in android to get the Register Id you have to get it from the $cordovaPush:pushNotificationReceived event before I would able to keep sending messages.
@Jansen I tried this tutorial, it helps me a lot but he is a little bit out of date.
this is my register function:
$cordovaPush.register(config).then(function (result) {
console.log("Register success " + result);
if (ionic.Platform.isIOS()) {
// code for ios ...
}
}, function (error) {
console.log("Register error " + error);
});
here is my notification received listener:
$rootScope.$on('$cordovaPush:pushNotificationReceived', function (event, notification) {
console.log('push Notification Received');
if (ionic.Platform.isAndroid()) {
// code for android ...
}
});
the console.log('push Notification Received'); didn’t occur at all
I don’t understand what you mean.the listener is in my controller, the register function also in this controller and it works.
I was debugging the cordova code and it seems it doesn’t get to the onNotification function, that from there the broadcast sent,
maybe I didn’t do something in the GCM?