Search code examples
apple-push-notificationswatchkitapple-watchapple-mapswatchos

Open Apple Maps by tapping on a WKInterfaceMap in a dynamic notification


My Watch app receives push notifications containing location information and I use that info to show a WKInterfaceMap.

However, when I tap on the map in the notification dynamic interface, my app is opened instead of the Maps app.

I found this forum post stating:

There is no url to call at this time. The user tapping on a WKInterfaceMap object is the only way to launch the Maps app from yours.

Does anyone know why this does not work with WKInterfaceMap objects in a notification?


Solution

  • Since notifications are not interactive, it's not possible to trigger any object interaction in a dynamic notification. Tapping anywhere in the notification area will always launch your watch app.

    This is briefly mentioned in the App Programming Guide, under Designing Your Dynamic Interface:

    Tapping your notification interface launches the app, so notification interfaces should not contain interactive controls.