Can't get Ionic Push notification to work

I setup my application using the documentation. I identify the user before I register and I can see the device token both on the device and the dashboard. I have generated both development and production certificates that I have uploaded.

But I can’t receive any notifications. Have tried the dashboard and using curl and they both says that the notification was successfully sent. But I never receive it.

I tried to switch between dev_push true and false, as well as the two certificates I uploaded.

What could be wrong.

I had this issue too. Did you tried to platfirm rm and add again. For me this solves the problem.

Now dev_push true works, but still no notification when dev_push is set to false.

It looks like you are using the Ionic Push service. Can’t help you there as I am not using it.

However I have just made a tutorial on how to make a basic “Hello World” app with push notifications.
Build it with Ionic and PushPlugin, then send notification with a simple python script. No 3rd party services. Might be worth a read :slight_smile:

@Sverin Seems to me you dont have setup certificates.
Are you on IOS or Android?
Do you use xcode?

@pcr I’m on iOS and using xcode. I tried to recreate both development and production push certificate and recreated the provisioning profiles for the app. I uploaded the new certificates and inserted the new provisiong profiles for xcode. However, it did not work.

I can see the following in the xcode console:

enabledRemoteNotificationTypes is not supported in iOS 8.0 and later.
2015-08-13 21:47:24.750 MyAppName[688:247649] $ionicPush:REGISTERED XXXX…

Is it just REGISTER: XXX, or a device ID?

Does your app registered a user. Check your dashboard.

Its a real device id and yes it shows up in the dashboard as well on the console log.

Sounds great so far. I suggest you know how to send notifications to a specific device. Did you tried a one-time message to the device we were talking about. Best is to start your app and then put it in the background. IOS on the device should receive and display the notification on your device.

Did you set production-mode:
$ ionic push --production-mode=y

Did you push the proper items to ionic io about certificates. This should be the exports from your certificates in keychain. Right click and export a .p12 file. This file you have to push.

A few minutes ago I tested my app notifications. This time the notification appears after about 5 minutes. My app was in background. I saw a small message on top of my home screen.

@Sverin you said you generated development and production certificates.

You should only use one at the time- development one is used to register with the sandbox APN server. If you are using this one, your app should register with the sandbox server instead of production one.

My guess is you could be registering to one server, and sending your notification to the other.

How do I know which APN server I send to?

At the moment I have it working using dev_push false and development APN (–production-mode=n). But as soon as I switch to production APN (–poduction-mode=y), it stops working. I delete the application and register it again after I switched.

How can I know it will work in production? Should I register every time the application starts or only the first time.

EDIT: I just read the documentation about production mode:

This requires that your app is built for release thru Xcode, and is subject to Apple’s reliability requirements.

Again, I am not sure how “Ionic Push” registers with APN. Perhaps looking into the javascript file might shed some light.
When using the Phonegap PushPlugin directly, you do not specify which APN server to register to from your javascript.
This is done via your explicid app ID in config.xml (this is in your ionic project folder).
You use this explicid app ID when creating app certificates and provisioning profiles in apple member center. These certificates should be created seperatly to enable either development or production server communications.
Provisioning profile is then managed by XCode, and certificate is used to send push notifications from your server side (ex . python script on your machine).
Here is a post I made on registering with the sandbox (development) server. I believe production registration should be very similar (different options in regisration are available).

Hope this helps :wink:

any idea- how to fix “enabledRemoteNotificationTypes is not supported in iOS 8.0 and later.”