I see others have asked the same question, e.g. iOS system alerts and receiving all alerts, that didn't get answered.
I tried that code for the 2nd one, but it only receives all alerts for that app. So if e.g. I get an SMS alert on the device with this app running, I just receive the following:
Notification found with:
name: _UIApplicationWillAddDeactivationReasonNotification
object: <UIApplication: 0x14dd01a40>
userInfo: {
"_UIApplicationDeactivationReasonUserInfoKey" = 10;
}
Notification found with:
name: UIApplicationWillResignActiveNotification
object: <UIApplication: 0x14dd01a40>
userInfo: (null)
So that's only the effect of the SMS dialog on the app, not the SMS notification.
As far as I can see there is no way in an iOS app sandbox to receive all the system notifications (e.g. Facebook, WhatsApp, Twitter, SMS, Call, Missed Call etc etc). The only way to get these is via a BLE peripheral that can solicit for ANCS.
Is this correct ?