IOS 8 Silent push notification not working without Xcode - ios

I'm trying to test out the silent push notification and I notice that my Iphone (IOS 8) can only receive silent notifications when my device is connected to Xcode. While it is unplugged, I can only receive one silent push in probably 5-10 tries. This only happen to IOS 8 because I have another phone which is running on IOS 7 and not even a single silent push is missed. Anyone face the same issue ?
More details:
If the phone is connected to power source, I'm able to get silent push notifications perfectly...

I have encountered similar issue. If my iPhone connects to the Xcode, it can be woken up successfully by silent push notification. However, if it disconnects to the Xcode, silent push notification can ONLY be received without being woken up to perform background fetch.
The root cause for my case is that I turned off the "Background App Refresh" on my device. ("Settings > General" > "Background App Refresh")
After I turn it on, my iPhone can work as expected again.
Good Luck!

Seems like you are using Debug certificate while interacting with APNs from the server side. And it only works while a device is in the debug mode.
For untethered push notification handling, you need to use Release certificate.
This article would give a better understanding on using certificates with APNs:
https://quickblox.com/developers/How_to_create_APNS_certificates

Sounds like a network issue to me. Are you sure that the PNs are actually delivered to your phone?
You could disable cellular radio (PNs are always delivered over cellular data even if on wifi) and use, e.g., tcpdump in promiscuous mode on your local wifi in order to see if there's anything coming in. Just look for packets from 17.x.x.x. Apple warned us they'd rate limit silent PNs, maybe that's the issue here (while that wouldn't really explain why it works while your phone is plugged in).

I know this questions is old but, according to Apple documentation, receiving and processing of silent push notifications depends on the conditions of the system, so I think that because you have a power supply, device will not throttle the delivery of notifications. Here is what Apple says:
Important
The system treats background notifications as low-priority: you can
use them to refresh your app’s content, but the system doesn’t
guarantee their delivery. In addition, the system may throttle the
delivery of background notifications if the total number becomes
excessive. The number of background notifications allowed by the
system depends on current conditions, but don’t try to send more than
two or three per hour.

Related

iOS remote notification type

Is there any apns push that can wake application up, do something in background and keep silence?
I found two solutions, but still not perfect:
Background notification. It can wakes app up in the background and gives it time to do something, but Apple doesn’t guarantee the delivery and it can't work after device is rebooted
UNNotificationServiceExtension. It can wakes app up and do something in the background, even if the device is rebooted. But, it can't be silent.
Our flow on iOS was:
Receive remote notification
Download data from server
Determine whether to notify from the content of the data
In iOS 12, our solution is PushKit, but it has some restrictions in iOS 13 now, so we have to make some changes.
Could anyone give me some advice, please? Thanks.

After upgrade to iOS 11, iOS App not receiving APNS message when in Background

After upgrading iOS device to IOS 11 Beta version, my app has stopped receiving APNS message when it is in background. It does receive the message when it is in foreground. As per the device logs, APNS messages are being delivered to the device and are available in the notification center.
Has anyone experienced this issue?
This seems to be the global thread to jump onto. Not resolved, but has to do with iOS11 throttling / no-delivery of notifications in certain circumstances. Actually a lot of circumstances.
Very painful, as we depend on the delivery of silent pushes when app is active.
Silent pushes not delivered to the app on iOS 11

VoIP app / restore connection on reboot

I developed a VoIP app and I read from the documentation that a VoIP app automatically restarts on phone reboot. However, DidFinishLaunchingWithOptions is not called on reboot so my connection cannot be restored.
The only way to reconnect is to start it manually it seems.
I can see the app is in memory, because it is quite quick to start when I click on it, but I thought the app should be able to restore its connection without user intervention.
Any thoughts? What am I missing? Is there another callback in AppDelegate that I missed?
The app is capable of receiving remote notifications in this state.
According to
Voip Pushkit notification will not re-launch the app if it was force-quitted and device was rebooted
this seems to work in most cases.
I have not found any official documents on this.
EDIT:
Here
https://developer.apple.com/library/ios/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html#//apple_ref/doc/uid/TP40015243-CH30-SW1
is the official documentation on pushkit, which describes that the app is woken up, even if it not running or in background mode.

NSNotification on device reboot

Is there a way to know when the device is rebooted in ios, like "BOOT_COMPLETED" permission in android. Went through internet and could not find and appropriate answer. Any help would be appreciated.
https://github.com/lithium3141/BootLaunch
You can refer this page but one think, if your app doesn't have voip feature means Apple will reject your application.
Apple State in their document:
https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW1
UIBackgroundModes
voip-The app provides Voice-over-IP services. Apps with this key are automatically launched after system boot so that the app can
reestablish VoIP services. Apps with this key are also allowed to play
background audio.
remote-notification-The app uses remote notifications as a signal that there is new content available for download. When a remote
notification arrives, the system launches or resumes the app in the
background and gives it a small amount of time to download the new
content.
This value is supported in iOS 7.0 and later.
voip key is the technique used most of the voip applications like skype.

Toggle iPhone Charging through OS X or XCode

I'm currently writing an iOS application and am receiving battery status change notifications. Of course, when I'm debugging my app it would be nice if I could toggle the battery status without unplugging my phone. Is there any way to do this via OS X or XCode, that is, while having the phone plugged in tell it to stop charging so I can test my notifications and actions?
Due to Apple's sandboxing regulations and firmware, you can not tell the phone to stop charging. This is a service extremely close to the core of the phone, and it can not be programmatically accessed.
Of course, when I'm debugging my app it would be nice if I could toggle the battery status without unplugging my phone.
Since you can't do that (per the accepted answer), an alternative that will help you debug is to create and send your own battery status notifications. The notifications are regular old NSNotification objects, and you can create and send your own with the name set to UIDeviceBatteryLevelDidChangeNotification or UIDeviceBatteryStateDidChangeNotification. That should let you trace through any code that would normally run when your app receives those notifications.

Resources