When you create a new Apple Watch application in Xcode, the following APNS payload example is created:
{ "aps": { "alert": { "body": "Test message", "title": "Optional title" }, "category": "myCategory" }, "WatchKit Simulator Actions": [ { "title": "First Button", "identifier": "firstButtonAction" } ], "customKey": "Use this file to define a testing payload for your notifications. The aps dictionary specifies the category, alert text and title. The WatchKit Simulator Actions array can provide info for one or more action buttons in addition to the standard Dismiss button. Any other top level keys are custom payload. If you have multiple such JSON files in your project, you'll be able to select them when choosing to debug the notification interface of your Watch App." }
I am confused by the use of the body and name in the alert dictionary. IOS applications typically use the following payload:
{ "aps": { "alert": "Test message", "title": "Opt title", "category": "default" }, "WatchKit Simulator Actions": [ { "title": "First Button", "identifier": "firstButtonAction" } ], "customKey": "Use this file to define a testing payload for your notifications. The aps dictionary specifies the category, alert text and title. The WatchKit Simulator Actions array can provide info for one or more action buttons in addition to the standard Dismiss button. Any other top level keys are custom payload. If you have multiple such JSON files in your project, you'll be able to select them when choosing to debug the notification interface of your Watch App." }
What is the right way? Although the default payload file is created this way, Apple's documentation provides a screenshot using the latter.
ios watchkit apple-push-notifications
edwardmp
source share