This is a long shot, but are there any public (or private) API's that allow us to read existing push notifications on an iOS device? For example, can an app running in the background pole the system every X seconds to determine if the device has received a push notification from the Stack Exchange app and get it's 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 pole 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.
4 Answers
Answers 1
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."
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.
Answers 2
No, that's not possible. It seems that it will be a privacy issue if other apps will read other apps push notifications content.
Answers 3
Apple would never give such API private/Public, this will violate apps security.You can only read your apps push notifications.
if you use private API , there is good chance that your app will be rejected when you submit to app store.
some possible solutions to your app.
1) Figure out is there any way your app gets that push notification.
2) Or you have to use Inter-App Communication.
Answers 4
I interpret this question to be asking specifically in the lens of a IFTTT device that could already read/write data to a "standard" IFTTT app, and you're wondering how that's done. To me, that's the question, and not asking about a hacky private API push notification system.
With that in mind, the solution is generally referred to as HomeKit
from what I know. It's one of Apple's "Kits", with general docs found here
What I think you're looking to do is more along the lines of database observation, where you're maybe looking to build some aggregator app of this data set stored on the device (which Apple has a standard method of asking users for permissions, and is fully allowed on the system just like Camera/Health/Photo permissions, etc).
Observing HomeKit database changes is found at a developer doc linked from the first, but found here
I haven't used this before myself, but from the docs, I can see there are methods for observation using regular old iOS KVO:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateHomes:) name:@"UpdateHomesNotification" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updatePrimaryHome:) name:@"UpdatePrimaryHomeNotification" object:nil];
There's a lot more info there, and I'm sure StackOverflow itself (and old WWDC videos of course) have lots of info on HomeKit. I hope this was the intended interpretation the question-asker meant. Similarly, though, each of the supported channels for events (HealthKit, MapKit, etc) can send you "push notification" type updates about what your user is doing with built-in APIs.
If you're attempting to simply read from other application's push payloads, then the other answers are correct and that is not possible on a pure privacy basis that Apple sandboxes your application: Apple Sandbox Docs Link
0 comments:
Post a Comment