Abhishek Bedi
Abhishek Bedi

Reputation: 5441

Add multiple buttons to Notifications on WatchKit Simulator

I am trying to add a Second Button to dynamic notifications screen on watchapp. But the simulator shows only the First Button.

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

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

}

Upvotes: 1

Views: 595

Answers (1)

Duncan Babbage
Duncan Babbage

Reputation: 20177

For the second item, you have your title labelled as your identifier and vice versa. Also, you are missing a comma between the two objects in your "WatchKit Simulator Actions" array. See syntax at json.org

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

}

Upvotes: 2

Related Questions