Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

iOS and MacOS / iOS push notifications being declined - cannot ask again

Author
Message
Naphier
11
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 28th Feb 2014 21:31
Just a note for iOS developers.
If a user initially declines push notifications the app is stuck in that state unless they uninstall the app for at least 24 hours.
https://developer.apple.com/library/ios/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG42

This is most unfortunate because unless someone uninstalls your app then there's no way to ask them again to enable push.
So this is just a note so everyone knows it is Apple's doing. If I find a way around it then I'll update here, but I doubt that will happen.
If you use push notifications then drive home the importance of them when first asking on iOS because you don't get a second chance...

Naphier
11
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 9th Mar 2014 22:16
A further note.
Uninstalling the app for 24 hours does not seem to work on it's own.
I believe the user may also have to either reboot the device or do a full restore. None of these options are favorable to the developer.

xGEKKOx
AGK Master
13
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 15th Mar 2014 16:16
What are you using for Push notifications?
OBJ C or AppGameKit?

I use OBJ C and is all ok.

Long life to Steve!
Naphier
11
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 15th Mar 2014 16:48
There's nothing wrong with AGK's implementation of push on iOS. This is a fairly well-known iOS "feature". Maybe you don't know that it is happening. What happens is if the user is presented with the iOS dialogue "this app wants to send you push" and they decline. Apple iOS does not allow you to ask again. They've had this reported as a bug for a long time, but have chosen not to change it yet. The original bug report in Apple is 15377505 and they are currently in the 16000000+ so they don't seem to care.
What we did instead is ask the user with our own dialogue if they want push. If they say no then they never see the iOS dialogue which semi-permanently blocks the app from obtaining a push token later.

You can try it out in your testing environment, but it gets a little weird. See the Apple technical note I linked above. It works if you set the clock on your device forward. One thing is that if you approve the app on the first install, but then you decline the app on the second install Apple provides the app with the token, but APNS does not deliver. It's all very annoying. Android is so much easier with push on client side and server side.

Do you use your own server for sending push notifications?

xGEKKOx
AGK Master
13
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 17th Mar 2014 01:57
Yes i use my own server.
For me is all ok, they work perfectly if they deny.
Usually the iOS ask you it again each time you reboot the App.
Exactly, i always set the clock on forward, also if only for 1 second.

Anyway, i will investigate. If i'm right, if you are interested i can send you the code in OBJ C.

Long life to Steve!
Naphier
11
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 17th Mar 2014 03:34
I'm not sure how you're able to re-ask every time the app reboots (do you mean is reinstalled?). Maybe it is more of an issue with older iOS versions and in 7+ it is now OK. I did have one person who is using iPhone 5C initially decline, but then later was able to set them up. I also can uninstall, push the clock forward, reboot, reinstall and then the ask comes through again just fine. Something weird though - if the user says OK to push on the first time then reinstalls later and says NO then I can still obtain the push token without Apple's dialogue... Apple probably wouldn't like this if they knew. So once the YES permission is set, it seems it is always set.

At any rate, Apple recognizes this as a bug/issue. It's not a big deal because we just use our own confirmation prompt before showing Apple's prompt now. So if they say "no" to us then they never say "no" to Apple's dialogue, which allows us to ask again later without issue.

I'm not sure if I need the Obj C code, but I might take you up on your offer later.
Do you use your own PHP scripts or did you install something like EasyAPNS?
We're running into small issues where DNS wasn't resolving quickly enough and the push would be sent, but the response to our app was very slow. So I need to send off my process for push notification to be handled on it's own thread instead of in the same script that sends the response to the game.
If you'd be willing to share your scripts I'd love to see them.

Thanks!

xGEKKOx
AGK Master
13
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 17th Mar 2014 20:57
I use my personal dedicated with personal PHP code.
I have 2 kind of push notifications:
- The standard push iOS
- My personal notifications translated in local notifications (by the server)

In that way i'm always sure a notification arrive to the user.

Having a linux dedicated server is the 1st thing you must develop before releasing apps.
In that way you can take trace of all the things you need, stats, in app, sells, notifications, ID, users, etc.

Long life to Steve!
Naphier
11
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 17th Mar 2014 21:00
I'm using a VPS with my own PHP code too.
Without a server Wordspionage wouldn't have been possible.
I'd love to see some of your push notification PHP code for me to compare with. We're just getting started using the feedback service and I also want to fork the push notification script. I'd love to see what someone else is doing in a live real example.

xGEKKOx
AGK Master
13
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 18th Mar 2014 01:09
Well, i would be honored to show it, but i can't.
My server side is soo big and soo complex.

I have it divided in 3 dedicated linux servers :
A) Nginx + PHP5-FPM
B) PHP dedicated processes
C) MYSQL server

The forum is on a complete different host.

All of those are connected in a local network on the fastest european server farm.
All in linux, and the access are routed with a round robin or IP based done by a personal php code.

And all of this code and procotols are crypted with my personal encryption.

I coded my php servers process in a modular way, so push notifications, is a module of that.

Long life to Steve!
Naphier
11
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 18th Mar 2014 01:12
Yeah sounds like it wouldn't work for my singular use.
Thanks anyway.

Login to post a reply

Server time is: 2022-09-29 12:16:46
Your offset time is: 2022-09-29 12:16:46