1

我正在尝试Second Button在 watchapp 上添加一个动态通知屏幕。但模拟器只显示第一个按钮。

{
"aps": {
    "alert": "Test message",
    "title": "Optional title",
    "category": "myCategory"
},

"WatchKit Simulator Actions": [
                                   {
                                       "title": "First Button",
                                       "identifier": "firstButtonAction"
                                   }
                                   {
                                       "identifier" : "Second Button",
                                       "title" : "secondButtonAction"
                                   },
                               ]

}
4

1 回答 1

2

对于第二个项目,您将您的标题标记为您的标识符,反之亦然。此外,您在“WatchKit Simulator Actions”数组中的两个对象之间缺少逗号。请参阅json.org上的语法

"WatchKit Simulator Actions": [
                               {
                                   "title": "First Button",
                                   "identifier": "firstButtonAction"
                               },
                               {
                                   "title": "Second Button",
                                   "identifier": "secondButtonAction"
                               },
                           ]

}
于 2015-01-08T11:20:16.640 回答