I'm having a similar issue to Push Notification not working in ios 8.3
The push notifications are being received by 8.1 iphones but those sent to 8.3 iphones are NOT received.
I have updated my xCode to the latest (6.3.1). That does not seem to be the issue here.
I'm trying to send the push notifications both through the app as well as parse.com. The app does request permission to receive push, but that is not the issue.
This was suggested as a possible solution, though I don't understand where to include it. I have it included already for stripe. Though the notifications related to sending users a message that a stripe payment was made isn't working either:
Did you put this in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions ???
Any other suggestions much appreciated.
You should receive incoming push notifications in the -application:didReceiveRemoteNotification:fetchCompletionHandler: method on your application delegate, this is consistently called for applications on cold start and when already running in iOS 7+.
After updating the OS from 8.1 to 8.3, the device token for the app may change. Thats why Apple always suggests to call the
[[UIApplication sharedApplication] registerForRemoteNotifications];
every time you open the app. And update the latest device token to your server database.
Related
I'm working on an iOS application which had Background Fetch enabled via the Info.plist for around a year. There were multiple versions released with background fetch enabled, but then a few weeks ago the feature that necessitated background fetch was removed. The UIBackgroundModes key was removed completely from the Info.plist, and the app was released to the App Store.
Surprisingly though, telemetry indicated that the application was still being launched in the background periodically! This is a snippet from the actual app delegate source code:
- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
// NB: this callback should NEVER happen! But if it happens, we want to know about it.
... send telemetry log here ...
completionHandler(UIBackgroundFetchResultNoData);
}
Has anybody experienced anything similar? According to the documentation, it should be impossible for the app to be launched if the UIBackgroundModes dictionary don't contain the right values. In this case, there's no background mode turned on at all, yet the app is periodically launched in the background to perform the fetch...
Telemetry data indicates that it happens on iOS 11 only, but that might be a coincidence because only a small fraction of the installed base is on iOS 9/10.
BTW a source level assistance request was sent to Apple with this issue, but they haven't replied yet; but maybe developers of other apps have encountered this issue before.
I have many users complaining that when they migrated from iOS 10.3.3 to iOS 11 launched yesterday, they stopped receiving silent push notifications.
One thing is to be noted that, I have a setting in NSUSerDefaults if I have already asked the user for registering for push notifications. And I do :
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
Only if the user hasn't been asked before.
Now if user had already registered for notifications when he was on iOS 10.3.3, and upgrades to iOS 11, the code registerUserNotificationSettings:settings will never be called for him, until he reinstalls. Could that be an issue? However, I believe it is unnecessary for him to register again as he already is.
So how do I fix this?
From documentation:
It is recommended that you call this method before you schedule any
local notifications or register with the push notification service.
So it is advised to call it at least once per app launch, but before your server sends the push notification.
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.
I've read about the woes of silent push notifications in iOS, so this will likely be fruitless ... but I figure I'll ask if only to just maybe have an Apple rep see it.
I'm sending a simple APNS message to an iOS 8.1 app:
aps: {
content-available: 1,
priority: 5
}
The app is in the background (read: I have not force-closed it).
Sometimes my app delegate's didReceiveRemoteNotification with fetchCompletionHandler fires, sometimes it doesn't. I can tell because I am monitoring my server and can see if/when a GET request arrives.
I'm currently exploring if there's a correlation with passing weather systems and/or bird migration patterns.
But what's really frustrating is that when I build/launch my app via xCode, here's the console output:
- appDelegate: received notification
- appDelegate: fetching stories
- appDelegate: application launched
- appDelegate: remote notifications approved
**** modal view controller: viewDidLoad
Notice the notification is "received" just as xCode is firing up the app, but before the application launches (?).
It's as though the device is receiving silent notifications but is sitting on them until xCode starts the app. Additionally, I've noticed that when the device is running the app & connected to xCode, silent push notifications arrive very reliably ... which would also suggest some sort of irregularity involving xCode.
Am I doing something wrong? Is anyone else seeing this phenomenon? Or is this just a bug with iOS / APNS?
I'm happy to try out any code snippets or suggestions anyone has! Thank you.
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