Previously, when building my app using the iOS 9 SDK, the push notification authorization request alert (that system alert which says: "App" Would Like to Send You Notifications ... Don't Allow / Allow) would only show when I called [[UIApplication sharedApplication] registerForRemoteNotifications].
We've decided to actually only do that at a certain point in the game, so the user is only encouraged to allow push notifications when it makes sense.
On iOS 10, I understand we must use the User Notifications framework to accomplish that (by calling requestAuthorizationWithOptions:completionHandler: on [UNUserNotificationCenter currentNotificationCenter]), enable Push Notification on the app Capabilities and setup the entitlements. And that does work on some devices, but not all of them.
On some devices, the authorization request is presented to the user right at app launch even though I did not call requestAuthorizationWithOptions:completionHandler: or registerForRemoteNotifications at any point yet.
The weirdest part is that this happens consistently on some devices (running iOS 10.1.1 or 10.2 beta), even if I install the AppStore version of the app (which was built using Xcode 7 and iOS 9 SDK).
Should I assume this is a bug of iOS 10? I couldn't find other people with the same issue, only a kinda similar issue here.
The issue is actually a change from iOS 9 to iOS 10 on Game Center's [GKLocalPlayer localPlayer].authenticateHandler.
When it is set, it will trigger a push notification permission request on iOS 10. This did not happen on iOS 9.
For anyone stumbling upon this and not finding the above answer to have been the cause of their problem, it should be noted that attempting to change the app badge will also result in a Push Notification request.
My personal situation was regarding a Cordova app, where I was loading and applying the badge plugin before initialising push, and couldn't work out why the Notification permission dialog was appearing on app launch.
Related
A few days ago, I got the issue below.
I've been getting notifications for the past several days. The notification had been enabled, and the app was working (I received push notification) until it suddenly didn't yesterday. And when I open the app, it suddenly asks me to enable notification (please see the picture "iOS Push Notification Permission Alert.png")
iOS Push Notification Permission Alert.png
I guessed that my client removed the app and re-installed, so all permissions were lost. But they said that they didn't.
So, How can it happen?
My concerns are:
If notification was enabled, how can it show the alert above again? Is there a possible way?
If notification was not enabled, why have I received the notification for the past several days?
Under which scenario(s), would an app suddenly disable already enabled notification? Is there a way to disable notification permission for the app on the iOS phone by programming?
I will appreciate your answers so much!
P/s: I read the post disable push notification in app, but it doesn't help for my questions.
This is only possible if the app is reinstalled or the notifications are turned off from the settings.
There is one setting in iPhone which will allow iPhone to offload the unused apps and if this happened, there will be a cloud icon on the left of app title.The app will be reinstalled when you click it again.
And it seems that it will also happened when the storage of iPhone is not enough.
So I guess this happened in your client's phone.
This setting is in both Setting-iTunes & App Stores-Offload Unused Apps and Setting-General-iPhone Storage-Offload Unused Apps.
There's lots of problems with push in general in iOS 11.0n. I have two apps, one uses silent pushes and I can reproduce problems with the pushes not being delivered. Theres nothing I can do to fix it, its an Apple issue, they have changed the behavior of silent pushes and also introduced a bug with iOS 11.0.
However I also have another app which uses VoIP push. WhatsApp uses VoIP push and their users have been experiencing lots of notification issues with iOS 11.0n too:
https://whatsappen.com/news/5465/many-complaints-whatsapp-notifications-ios-11-update-solution
That link above (and WhatsApp web site states something sililar)
It’s indeed an iOS 11 bug. It is affecting users who habitually force
close their app.
I'm unable to reproduce any similar issue with my app which uses VoIP push (tried force quitting it several times).
And that's my problem - the fact that I can't reproduce it. Just because I can't reproduce it doesn't mean it doesn't affect my app.
If there is a problem with VoIP push and therefore potentially with my app's behavior I would like to reproduce it, and fix it.
WhatsApp claim they fixed their issue without waiting for a new release from Apple, so it must be something they can work around.
I would like to know if anybody knows what this VoIP push problem is with WhatsApp and what they did to fix it.
I've got a project I'm working on which uses VOIP notifications to "wake up" apps that have been put into background/terminated. These notifications are sent periodically, and everything seemed to work fine until recent iOS updates.
It appears that after a certain amount of time in which the app has been in the background (happens to some users after 5 minutes, others after 20), the devices no longer process any code after receiving the voip notifications.
I've read a bit in apple dev forums and some other devs are running into similar issues, all speculate if its related to the new iOS updates (10.3.1/10.3.2).
Has anyone else run into this issue, and if so, have you been able to solve it?
Thanks!
This is the new normal on latest iOS versions.
You should begin to use push notifications.
Here is a guide from Apple.
What ended up seeming to be the fix was updating to a newer version of socketio library.
You can try debugging your app in background or in kill state ( terminated state ), so you can get to know that payload from pushkit comes or not or possibly some crash at iOS code end.
Debug pushkit notification in terminated state
Put debug pointer on delegate methods
Go to edit scheme
Select run option then Launch -> Wait for executable to be launched
Send push kit payload from back end
Once you get payload on device
it will automatically invoke and debug pointer will invoke at delegate methods.
Refer
Suddenly my iPhone app stopped getting push notification.
I checked the server and the expiration date is valid. the app registering fine and send token ID without any problem.
What I noticed is that I have "iPhone Production IOS push service: com.mypackage" not expandable, I mean without the private key. I cant remember maybe somehow I deleted it.
The question is if I sign the app for dis/AD-HOC with a provision that enables the push notification, with that push notification (not expandable) key I may have problems getting push notifications?
You didn't specify what iOS version you are using. But, if it used to work on iOS 7 and the issue started on iOS 8, maybe it is because of Apple change of their push notification API on iOS 8.
For more info you can look on:
https://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS8.html
I want to reset the push notification setting for my app. I have read the apple documentation regarding resetting the settings (which didn't help) and some questions here as well (which didn't help either). So in the last I reset my iPhone by going to settings->General->Reset ->Erase All Content and Settings (That didn't worked as well.)
Any other solution?
BTW I am using iOS 6.1
https://developer.apple.com/library/archive/technotes/tn2265/_index.html
The first time a push-enabled app registers for push notifications, iOS asks the user if they wish to receive notifications for that app. Once the user has responded to this alert it is not presented again unless the device is restored or the app has been uninstalled for at least a day.
You can also move your clock by a day after uninstalling the app and try.