WatchKit通知有效负载示例

时间:2015-04-14 18:50:54

标签: ios apple-push-notifications watchkit apple-watch

您可能知道,在PushNotificationPayload.aps文件中,可以在" WatchKit Simulator Actions"上设置操作。节点

有人能为我提供包含操作的真实推送通知有效负载吗?

谢谢!

1 个答案:

答案 0 :(得分:1)

我们使用看起来像这样的测试有效负载:

{
    "aps": {
        "alert": {
            "title": "My Alert Title",
            "body": "The body message",
        },
        "category": "myCategoryName"
    },

    "WatchKit Simulator Actions": [
           {
           "title": "Like it!",
           "identifier": "MY_LIKE_ACTION"
           }
    ],

    "myCategoryDictionary": {
        "image" : "http://.....",
        "subject" : "The subject of the alert message",
        "content": "Detailed content info can go here"
    },

    "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."
}