Push notification dialog not appearing anymore (unable to get device token)

My main answer was how to turn push on and off after the popup was already asked. If your app is installed, it will be listed under settings->notifications. The original popup has no reason to be asked again. The setting can be changed under settings.

Whenever you run an app for the first time, that is push enabled, you should get the remoteNotification event. That should happen even if you uninstall and then reinstall right away. Think of the popup as simply a courtesy the first time the app is installed on a device. It simply asks whether you want it turned on or off in settings->notifications. It doesn’t stop the app from ever being used with push if the user later turns it on. So to get that popup again you would need to reset the device so it has no record of it being installed prior.

If you are not getting a remoteNotification on the new devices I would suspect your new certificate is not setup correctly. Any phone which had the app installed at any time prior is most likely getting the device token because it was given previously. Either Apple just reissues it or iOS has it saved somewhere and it has not expired.

From the blog by Corona it says the following and does not state what happens if something is wrong. It would be logical that you would not get the remoteNotification at all.

At this time, your app will then contact the Apple Push Notification Service (APNS) and if the provisioning profiles, certificates, etc. are good to go, then you’ll get back a device token. This is a unique string that’s needed for your own server to send push notifications to the specific device that the token is associated with.

[import]uid: 56820 topic_id: 34207 reply_id: 138166[/import]

Please visit this Apple techdoc:

http://developer.apple.com/library/ios/#technotes/tn2265/_index.html

And go to the tips and tricks. They explain how to reset it. [import]uid: 199310 topic_id: 34207 reply_id: 138178[/import]

I just want to point out that my experience with those procedures, just like with olav.morkrid, didn’t work. The popup never returned. Maybe a bug with iOS 6 or maybe the iPhone 4. That’s what I tried it on. [import]uid: 56820 topic_id: 34207 reply_id: 138191[/import]

did you try the set the clock ahead a couple of days trick? [import]uid: 199310 topic_id: 34207 reply_id: 138194[/import]

Ok as stated before I was going to give the uninstall a few days before trying again. I also decided to re-enable the native.alert box from the sample that shows the token when the remoteRegistration is received. This is how it went down.

Waiting until today, which is approximately 3 days, I installed my updated version. First thing I see is the popup showing me the token from the remoteRegistration event. So it fired right away. I hit ok and nothign else. I did not get any popup asking to allow push. So 3 days was still not enough to reset the official popup.

Now that I had the updated version on my phone I experimented more. I killed the app and restarted it. The popup showed again from the remoteRegistration event. I am not sure if that is how it is supposed to work. Every launch will cause the remoteRegistration event and provide the token. With that knowledge I will change my code to check this token to the one saved from a prior launch. If it’s different I will update it on the server.

@olav.morkrid
After experimenting, if you are getting no remoteRegistration events and the only thing you changed was the certificate, then everything would point to that being the problem. I have no idea why though. [import]uid: 56820 topic_id: 34207 reply_id: 138758[/import]

Well… I tried with a couple of other iPhones, and at least the last ones gave the device token just fine regardless of the choice made in the built-in iOS “Accept push” dialog. I will test some more phones, but let’s hope this was just some temporary weirdness and call it a non-issue until further notice. Thanks for the interest, guys.
[import]uid: 73434 topic_id: 34207 reply_id: 138801[/import]

Yeah I tried that trick first. Waiting 24 hrs was silly for me when I am using test devices that can be reset within minutes. Later I did try 24 hours but it didn’t work.

For curiousity’s sake I have deleted my test app again and will wait 48 hours. For me it’s still faster to just reset, however I understand for other situations an alternative solution would be better. I hope it works giving it more time. [import]uid: 56820 topic_id: 34207 reply_id: 138327[/import]

Oh on the subject of tokens, quick question Rob. I never have taken into consideration the expiration of the token. I have read it can expire after a couple years on it’s own. That’s hard to test in a real world scenerio given the time needed. Do you know what happens when it expires? Will our app just receive another remoteRegistration with a new token? [import]uid: 56820 topic_id: 34207 reply_id: 138330[/import]

Just on the outside chance, you are:

  1. deleting the app
  2. setting the clock forward in time
  3. Installing the app

As for the 2nd question, I have no idea. [import]uid: 199310 topic_id: 34207 reply_id: 138388[/import]

We tested on several devices and were always able to get the “remoteRegistration” event even if we selected “Don’t Allow” on the initial dialog. We just went into “Settings / Notifications”, allowed notifications and when we next opened the app, the “remoteRegistration” message arrived.

I fear that we’re not truly reproducing your issue but it might also be that the issue is an artifact of your testing environment. If you have any more suggestions on how to test this I’d love to hear them. [import]uid: 199237 topic_id: 34207 reply_id: 138394[/import]

@Perry: Your posting was the most clarifying and reassuring so far. You’re basically stating that the device token is not “lost” upon initial rejection via the dialog, which is a relief, and so the problem must be elsewhere. The phone UDIDs are all added to the development provisioning profile, so then I just don’t know.

@anderoth: Yes: The last time I tried rejecting the dialog, I didn’t get any “remoteRegistration” event at all. What conclusions can we draw from this? [import]uid: 73434 topic_id: 34207 reply_id: 138572[/import]

Ok as stated before I was going to give the uninstall a few days before trying again. I also decided to re-enable the native.alert box from the sample that shows the token when the remoteRegistration is received. This is how it went down.

Waiting until today, which is approximately 3 days, I installed my updated version. First thing I see is the popup showing me the token from the remoteRegistration event. So it fired right away. I hit ok and nothign else. I did not get any popup asking to allow push. So 3 days was still not enough to reset the official popup.

Now that I had the updated version on my phone I experimented more. I killed the app and restarted it. The popup showed again from the remoteRegistration event. I am not sure if that is how it is supposed to work. Every launch will cause the remoteRegistration event and provide the token. With that knowledge I will change my code to check this token to the one saved from a prior launch. If it’s different I will update it on the server.

@olav.morkrid
After experimenting, if you are getting no remoteRegistration events and the only thing you changed was the certificate, then everything would point to that being the problem. I have no idea why though. [import]uid: 56820 topic_id: 34207 reply_id: 138758[/import]

Well… I tried with a couple of other iPhones, and at least the last ones gave the device token just fine regardless of the choice made in the built-in iOS “Accept push” dialog. I will test some more phones, but let’s hope this was just some temporary weirdness and call it a non-issue until further notice. Thanks for the interest, guys.
[import]uid: 73434 topic_id: 34207 reply_id: 138801[/import]

Registration Notifications Still Working?

Can anyone verify for me that registration token notifications are still working from APNS?

We’ve had an app working for weeks with pushes and all of a sudden we are never getting the registration token on start up. We have not changed anything about the server or provisioning profiles, or certs or anything like that.

I’ve reverted all our app code back to the last time I know tokens were working so that we’re basically the same as the original push notifications sample code from the tutorial.

We’ve totally reset all the devices and we’re never getting the registration notification on start up.

Just looking for confirmation from someone that’s using them that they are still working (i.e. Apple hasn’t broken something with an update or the like).

Is there any way to troubleshoot those messages? Or any common reasons for not getting them? [import]uid: 13063 topic_id: 34207 reply_id: 144582[/import]

Ah, I think I’m having the very same issue as @jleigh noted above. My push notification was working fine until it suddenly stopped. During test/dev process, I’ve done lots of device resets including restoring to factory default, but whenever I deleted and reinstalled the app (with or without device reset), the registration notification always popped up after reinstalling the app (and by registration notification I mean the dialog that says “Do you want Push Notifications for this app?”.) However, it seems like it never pops up again – and no push notifications are received by any device I’ve tried. And yes, I’ve checked each device’s push notifications setting and they are all turned on for my app.

I have not changed my code from the time push notification was working, and I do use the device token that is freshly provided by the device each time.

I also ran the push notification manually by launching a simple PHP script from my browser (and I plugged in a valid device token to test it). The result I get is the “Push notification successfully delivered” message. Despite all that, the device isn’t getting any notification.

What could be going on here?

Naomi [import]uid: 67217 topic_id: 34207 reply_id: 144587[/import]

I am going to go out on a limb here and say I think this is Apple. I noticed in the last 2 weeks that when my app sent pushes I would only get about 1 out of 4 actually showing up at the destination. When they did, they would show up much later than usual. In the last few days I am not getting any at all.

I sent a test message to my phone through the Parse website. It’s been about 25 minutes and still nothing.

[import]uid: 56820 topic_id: 34207 reply_id: 144590[/import]

Thank you, @Anderoth. It does sound like something is up with Apple. I guess I’ll leave the push notification the way it’s set up for now and see how it goes…

Naomi [import]uid: 67217 topic_id: 34207 reply_id: 144594[/import]

Came back from dinner and tried again (without changing anything at all) and magically everything is working again.

Thanks Apple for a wasted day…

So I just put back all my code from this morning (before I reverted to troubleshoot this issue) and that version is working again also.

Next time I guess we’ll know better. [import]uid: 13063 topic_id: 34207 reply_id: 144596[/import]

Forgot to say thanks for confirming the issue guys/gals. [import]uid: 13063 topic_id: 34207 reply_id: 144597[/import]

Registration Notifications Still Working?

Can anyone verify for me that registration token notifications are still working from APNS?

We’ve had an app working for weeks with pushes and all of a sudden we are never getting the registration token on start up. We have not changed anything about the server or provisioning profiles, or certs or anything like that.

I’ve reverted all our app code back to the last time I know tokens were working so that we’re basically the same as the original push notifications sample code from the tutorial.

We’ve totally reset all the devices and we’re never getting the registration notification on start up.

Just looking for confirmation from someone that’s using them that they are still working (i.e. Apple hasn’t broken something with an update or the like).

Is there any way to troubleshoot those messages? Or any common reasons for not getting them? [import]uid: 13063 topic_id: 34207 reply_id: 144582[/import]