Search code examples
iosnotificationsbluetooth-lowenergycore-bluetoothancs

Receive iOS system (e.g. SMS) notifications


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 ?


Solution

  • You are correct. The only way to request these notifications would be through BLE ANCS protocols which can be subscribed to by peripherals in communication with an iOS device.

    An off-the-top reason I can think of for this is to avoid people being able to do any form of monitoring by essentially 'crawling' and accruing these notifications in a malicious manner.