I wanted to know how to be able to read and get the contents of another app's push notification in iOS. Such as a push notification from Facebook Messenger, or Twitter.
I know this is possible because that is exactly what the Pebble Smartwatch iOS app does. It intercepts the push notifications of the iPhone and sends them to the smartwatch over Bluetooth.
Devices such as the Pebble, use the ANCS service with Bluetooth. An app cannot directly access the notifications for/from other apps.
Related
I'm developing an app with a watchkit integration and am trying to get the watch to receive a push notification over wifi even if the phone is paired with is disconnected (in this case in airplane mode).
But notifications are not going through to the watch when I try to send them to the paired device token. Which I suppose is to be expected. But is there a way to send a notification directly to the watch? Without having to rely on the watch being connected to the phone?
Accordingly with their doc it seems impossible for the watch to receive remote notifications if the phone is disconnected.
To receive SMS from third-party apps, MMS from third-party apps, or push notifications from third-party apps on your cellular model of Apple Watch, your paired iPhone must be powered on and connected to Wi-Fi or cellular, but it doesn't need to be nearby. You also need to be signed in to iMessage on your iPhone.
From: https://support.apple.com/en-us/HT205547
I need to intercept the following push notifications from my application:
SMS / iMessage
WhatsApp
Telegram
I will be sending those directly to show on an external device display via Bluetooth.
I see Pebble are doing this:
https://help.getpebble.com/customer/portal/articles/1191239-setting-up-ios-notifications
Is this accomplishable? or Apple's sandbox policy prevents me?
If Apple are the problem, how does Pebble handle this?
Thanks :)
You probably want to look at 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".
I presume this would require custom code to be written on the Bluetooth device, so it depends what you have access to. But as far as I'm aware, this would be the only way to send notifications for apps other than your own to be sent to a connected Bluetooth device.
On iOS, we can register for push notifications using the registerForRemoteNotifications method on UIApplication.
I want to create a watchOS 2 app that will work even if my watch is not connected to my phone (but is connected to Wi-Fi). I would like to send push notifications from a server to the watch directly. Is there a way to do this?
If so, what are the equivalent of these methods in a watchOS 2 extension?
application.registerForRemoteNotifications
application(:, didRegisterForRemoteNotificationsWithDeviceToken:)
application(:, didFailToRegisterForRemoteNotificationsWithError:)
application(:, didReceiveRemoteNotification:)
If not, what are my other options?
Currently there is no way to directly get notification from server on watch. As mentioned in Notification Essentials for watch
Apple Watch displays local and remote notifications only if the
containing iOS supports them. For information about how to support
local and remote notifications in your iOS app, see Local and Remote
Notification Programming Guide.
This also mentioned that
When one of your app’s local or remote notifications arrives on the
user’s iPhone, iOS decides whether to display that notification on the
iPhone or on the Apple Watch
Now there are some scenrio in this, if your phone is active and notification arrives, it will be received on phone. but if phone is locked and watch is active and then notification arrived it will be displayed on watch.
It is also mentioned in Apple Push Notification Service Doc that
Apple Push Notification service (APNs) is the centerpiece of the
remote notifications feature. It is a robust and highly efficient
service for propagating information to iOS (and, indirectly, watchOS),
tvOS, and OS X devices.
I have a small question about push notification sync between devices.
For instance, I'm building an iOS and an OSX app.
Both of them support push notifications and I send notifications to both devices at the same time.
Is it possible to "hide/dismiss" the push notification (or change badge) on an OSX device if I opened a push notification on my iOS device?
Like iMessages does.
I can't find any Apple API or third party service that does somthing like that.
Thanks for your help.
Does your app communicating with any server? If yes you can send information like "user-saw-content" to the server then send another push notification to cancel others notifcations if necessary.
I'm using Appcelerator's cloud services to send push notifications.
I'm sending notifications from both their web admin console as well as using their REST API. 2 iOS devices successfully subscribed, and i sent them notifications, but the devices never get the notification.
All ceritificate and provisions on Apple's dashboard seems correct. all Appcelerator's cloud responses seem successful, but still the notifications never display on the devices.
Any ideas?
Thanks