How can I access data from the iOS Notification Center?

I need to access notification data that accumulates in the Notification Center, similar to text messages, through BLE communication in my app. How can I achieve this?

Answered by Engineer in 793937022

That is not something you can do in an app.

The watch needs to implement The Apple Notification Center Service which will then receive the notifications directly from the system. It is not possible for your app to intercept and read notifications from other apps.

We don't understand what you are trying to accomplish. Please elaborate.

In general:

  • your app can access the notifications sent to itself in the Notification Center
  • your app cannot access any other notifications, like text messages, in the Notification Center
  • where does BLE come into play?

"I need notifications from other apps such as Facebook and Instagram in my app. For example, when a Facebook message arrives on my phone, I want to send the same notification to my own watch, which is connected via BLE."

That is not something you can do in an app.

The watch needs to implement The Apple Notification Center Service which will then receive the notifications directly from the system. It is not possible for your app to intercept and read notifications from other apps.

I have read the Apple Notification Center Service document.

The NP (Notification Provider) must hold the ANCS (Apple Notification Center Service), and the NC (Notification Consumer) must subscribe to the NP. This means that the NP should act as a Peripheral, and the NC should act as a Central, correct?

If that's correct, my current app (iOS) is functioning as a Central and is already capable of connecting to our watch (AOS) via BLE. Does it mean that roles need to be switched to implement the functionality?

Accepted Answer

This has nothing to do with your app. It is not sending the notifications to the watch. The watch will need to connect to iOS directly when it sees that it is advertising the ANCS service.

You cannot do this with an app. The watch needs to implement ANCS standalone.

How can I access data from the iOS Notification Center?
 
 
Q