Push not working on real device, but working as expected on emulators


#1

I set up the basics for push notifications and I am testing in with Android for the moment.
I followed those steps: http://ionicframework.com/docs/v2/native/push/.

It works fine on an emulator, but not on a real device.
Not even PushNotification seems to work.

When I tried the following on a real device:

Push.hasPermission((data) => {
          alert('checking permission');
          if (data.isEnabled) {
            alert('isEnabled');
          } else {
            alert('is not Enabled');
          }
      });

It gave me nothing at all. But again, on a real device, it gives me all the outputs.

I was hoping it could be about permissions, but I am starting to doubt it.

When I alert Push, it doesn’t have anything in it when I’m on a real device.


#2

I think it’s because I am using the ionic app view to test… I noticed it because it really behaves like it’s in a browser…


#3

Yes, ionic view does not support notifications. You’d need to test on a real device outside of View.