Android push notification not working

As per IONIC doc on android push notification

I setup all things but still when i try to send push notification from ionic app dashboard…It s not working…

Can anyone help?

Even If I open my app from android device using “IonicView” but it android device token does not set…

What could be the problem?

Hi,
I got my push notifications working until the other day when I update the app to the last ionic version (1.1.0) and then it stops from working (the push).

I have not being able to make it work so far but I have digged into the issue and these are my 2 cents:

  • Ionic 1.1.0 wraps up all previously independent service plugins into one ionic-platform-web-client
  • The inner push plugin has changed, instead of https://github.com/phonegap-build/PushPlugin (deprecated) now it uses https://github.com/phonegap/phonegap-plugin-push (which should be just fine).
  • I have followed the from scratch tutorial and it is NOT working.
  • After debuging ionic code it looks like onReady is not being called thus the service to retrieve a token is not being invoked.

From ionic.io.bundle.js:


    key: "register",
    value: function register(callback) {
      ...
      this.onReady(function () {
      //the flow never gets here

The onReady function checks wheter a _ready flag is true or waits for an ionic_push:ready event to be emitted but neither of these conditions is ever true.

Finally it looks like these to conditions are activated in Push.init (push.js) so it looks like this Push.init code is not being invoked.

I’m still under this issue so I will keep you updated.
Ivan.

Ok, I think I found a solution.

Basically my push code was not working because since a migrated from the previous version there was a module 'ionic.service.push’ being inyected in my main module:

angular.module('blunder', ['ionic', 'ionic.service.core', 'ngCordova', 'ionic.service.analytics', 'ionic.service.push', 'pascalprecht.translate'])

If would be great if the documentation (http://docs.ionic.io/docs/push-from-scratch) shows a warning for those who are migrating from a previous version.

do you mind sharing your code for a working push notification for the android?

Any news on this? I want to test and develop in browser which should be possible according to documentation, but the onReady function never gets called in Ionic 1.2 (that means register callback neither) - as blunder wrote previously. It gets there with no error, callback is set, but it’s never called in browser. When I launch the app on device it works, but that’s slow and tedious… Any help please?