处理Apple Watch通知: -如果我在通知界面中添加按钮(来自对象Lib),那么错误是:
通知界面中不支持按钮
PushNotificationPayload.apns有WatchKit Simulator Actions这样的:
"WatchKit Simulator Actions":
[
{
"title": "View",
"identifier": "firstButtonAction"
}
],
Run Code Online (Sandbox Code Playgroud)
和模拟器向我显示这个

现在我的问题是,从服务器View发送时如何处理此按钮PushNotification,
如果aps文件包含操作按钮是Apple Watch的唯一选项,
如何使用指定的密钥从通知字典中的服务器发送它?
如何更改动作按钮BG颜色?
会不会有人请给我的样本aps文件,其中包括ActionButton对设备the Apple Watch不为Simulator
我只是通过将WatchKit Simulator ActionsKey 更改为Key来测试,WatchKit Actions但它没有显示Action Button.
正如答案中的@vivekDas所建议的,我通过替换aps为:
"alert" : {
"body" : "Acme message received from Johnny Appleseed",
"action-loc-key" : "VIEW",
"action" : [
{
"id" : "buttonTapped",
"title" : …Run Code Online (Sandbox Code Playgroud)