Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS API to manage push notifications

This is a long shot, but are there any public (or private) APIs that allow us to read existing push notifications on an iOS device? For example, can an app running in the background poll the system every X seconds to determine if the device has received a push notification from the Stack Exchange app and get its contents?

The thought here is there are some services (such as the Ring Video Doorbell) that do not yet have public REST APIs. But when there is motion detected on the Ring camera, it sends a push notification. Similar to the popular IFTTT service, this app would poll for that notification on the device and then do something based on criteria set by the user.

I imagine there has to at least be a private API since Apple shows the device's recent notifications in the Notification Center.

like image 656
TheValyreanGroup Avatar asked Apr 06 '17 16:04

TheValyreanGroup


Video Answer


2 Answers

Even if it was possible to use an unsupported API that violated app security, the contents of the push notification are encrypted and you may not be able to read the contents.

However, Apple's Developer site has information on relaying and interacting with other app's push notifications over bluetooth for a bluetooth ANCS.

"The purpose of the Apple Notification Center Service (ANCS) is to give Bluetooth accessories (that connect to iOS devices through a Bluetooth low-energy link) a simple and convenient way to access many kinds of notifications that are generated on iOS devices."

https://developer.apple.com/library/content/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Introduction/Introduction.html#//apple_ref/doc/uid/TP40013460-CH2-SW1

This may not be applicable to you, but it is Apple's approved method for interacting with, and relaying push notifications from other apps to bluetooth devices.

like image 84
Linuxmint Avatar answered Oct 13 '22 01:10

Linuxmint


No, that's not possible. It seems that it will be a privacy issue if other apps will read other apps push notifications content.

like image 9
Shmidt Avatar answered Oct 13 '22 02:10

Shmidt