Hussain Shabbir
Hussain Shabbir

Reputation: 14995

How to set image on Apple Watch notification?

Is there any process to set the image on Apple watch notification.? I have tried adding in the image assets but did not find any clue.

Upvotes: 1

Views: 941

Answers (2)

Mark Semsel
Mark Semsel

Reputation: 7155

In order to display an image from a payload (via a URL, I assume) in a notification, you'll need to create a subclass of WKUserNotificationInterfaceController, which Apple provides as a way to display dynamic notifications.

Although originally written for Swift 1.2, the tutorial at this link can show you how this can be done:

http://www.brianjcoleman.com/tutorial-building-a-apple-watch-notification/

Upvotes: 1

Heps
Heps

Reputation: 995

I've noticed that there really is a possibility to embed additional image in notification payload which is displayed by Watch (but not iPhone/iPad).

Somehow Pushover guys managed to do this.

Pushover notification with image embedded

But I don't know how they did it. If I would get to know this I will post in answer edit.

Maybe you could ask them? (and post your conclusions here)

Upvotes: 2

Related Questions