How to transfer user from Apple Watch Notification to Apple Watch App? - ios

When a Push Notification is displayed on the Apple Watch, the only possibility to open the Apple Watch App is to tap the App icon in the upper left corner.
Now, as I´m reviewing our tracking data, no user seems to know this.
How can I install another tap area in the Notification View which transfers the user in the Watch App?

The first thing to understand is that notifications aren't specific to either the iPhone or the Apple Watch. They're the same old notifications we've been dealing with for years, and nothing has changed. That means that there's no such thing as an "Apple Watch-specific notification" or an "iPhone-only notification." iOS decides where to route a notification based on its own heuristics. There is no way to programmatically control which device receives an alert.
That said, stk is correct that you will have to add actions to a category that you set for your notification. The Notification Essentials section of the Apple Watch Programming Guide has some sample code.
Because there is no such thing as an iPhone- or Watch-specific notification, you're correct that you will see these actions on both devices. So, you'll have to do something meaningful on both platforms. This makes sense, because iOS decides where to send the notification, so it should be handled appropriately wherever it's sent.

Related

how to hide close button in iOS notification on apple watch

we're sending critical alerts to the user by remote notification. Users with an apple watch recieve those notifications at their watch display. at the bottom of the notification at the apple watch display, there is a "close" button displayed. If the user hits this close button, the notification seems to be purged by the os and the iphone app has no change to get the notification anymore.
As there is some data transported within the APNS Payload, this data is lost for the app.
We didn't do anything special for apple watch (like a watch app), we only deploy an ios app.
What is the preferred way to
a.) remove the close button in apple watch notification
b.) have the app to be able to access the notification payload if the user hits "close".
Any help appreciated

How to disable custom actions buttons on Apple Watch when receiving push notification

I am developing an iOS app with 3D Touch push notifications. The notification has a couple of custom actions defined.
When receiving the notification on an Apple Watch, these same custom actions are displayed. However, since:
I am not yet planning to create a companion Apple Watch app to handle the long-look interface of the notification, and
these custom actions require interaction with the iOS app based on an enhanced preview of the notification when received on an iOS device,
these actions make little sense on the watch.
Is there a way I can disable these actions when receiving a push notification on an Apple Watch?
Thanks in advance!

Is it possible to have a "notification only" app, or NOT show the watch app after a notification is displayed?

The iOS app I'm working on for a client currently only uses Apple Watch for notifications.
When a local notification fires while the user's phone is locked, it displays the notification on the phone. The user can dismiss the notification or click on one of the action buttons on it.
In either case, I want to dismiss the watch app and go back to whatever state it was in (back to the watch desktop, or springboard, or whatever it's called.) I don't want to present the UI for the watch app, since there isn't one, at least not yet. I don't know if my client is going to define a watch app UI or not.
As it is now, once the user clicks the dismiss button or an action button on the notification, the user is left with a stupid-looking placeholder watch app that simply has a button called "button" (which I added for testing.)
I'm afraid that you cannot change this. iOS decides which device the notification is shown on and you have no control over this.
If the iPhone is locked then iOS assumes that you are using your watch and will deliver the notification to it, however if your iPhone is unlocked it tends to deliver to notification to the iPhone.

How do you send a "tap" to an apple watch programmatically

I have a project in mind where I would have to be able to send a tap/haptic feedback/vibration to an Apple Watch. Is this possible with Watchkit? If so, how can I accomplish it. (preferably objective-c).
Unfortunately, there is no method in WatchKit to play a sound or trigger Taptic feedback. The closest you can get is to send a UILocalNotification, but even then, you can't control where that notification is displayed, as iOS decides whether to send it to the iPhone or the Watch. Hopefully this will be added in a future update.

How to set push subject as the title for push notification?

Is there any possibilities of setting push subject as the title in push notification?
I'm getting app name as the subject and description is same as given in the push. I want to change the title of the push.
Is this possible in iOS? I hope it is possible in android.
I just tested this on an iPhone 6s running iOS 9.1, and here's what I found: If the title field is provided as part of the alert dictionary, the notification on the lock screen will still show the bundle name. However, when viewing the same notification in Notification Center (accessed by swiping down from the top edge), the title is used in place of the app/bundle name.
When no title field is provided as part of the alert dictionary, the bundle name is displayed in both the lock screen and the Notification Center.
As of 2015, Apple has started using a title attribute but only seems to use when displaying a notification on the Apple Watch.
The title string used in the short look provides a brief indication of
the intent of the notification. For local notifications, you specify
this string using the alertTitle property of the UILocalNotification
object. For remote notifications, add the title key to the alert
dictionary inside the payload
This might indicate that it will be used also on the iPhone later on.
Source: https://developer.apple.com/library/content/documentation/General/Conceptual/WatchKitProgrammingGuide/BasicSupport.html
Here's an example JSON payload: https://gist.github.com/edwardmp/2295364f068b24084e67561c8e5c2944
Edit: As of iOS 9 this started working on iPhone and iPad as well :) I do note that this appears to only be displayed in the notification center and not on the lock screen.
You can't change the title. It's always the application name.
Suppose you are playing chess with your friend online. While you are in the chess app, your friend’s moves appear on the board right away. When you switch to another app—for example, to read email while your friend decides where to move—the app needs a way to notify you when your friend moves. This is a perfect use case for a push notification—something changed outside of the app that is of interest to the user.
The provider for the chess application learns about this move and, seeing that the chess application on your device is no longer connected, sends a push notification to Apple Push Notification service (APNs). Almost immediately, your device—or more precisely, the operating system on your device—receives the notification over the Wi-Fi or cellular connection from APNs. Because your chess application is not currently running, iOS displays an alert similar to Figure 1-1. The message consists of the application name, a short message, and (in this case) two buttons: Close and View. The button on the right is called the action button and its default title is “View”. An application can customize the title of the action button and can internationalize the button title and the message so that they are in the user’s preferred language.
You can refer your client to the official APNS docs to convince them that's the way it is.
Yes, you can add a title property since iOS 8.2.
A short string describing the purpose of the notification. Apple Watch displays this string as part of the notification interface. This string is displayed only briefly and should be crafted so that it can be understood quickly. This key was added in iOS 8.2.
Check the Apple Document - The Remote Notification Payload

Resources