【发布时间】:2015-03-31 04:03:59
【问题描述】:
我想给Apple Watch的通知添加值(当前屏幕使用硬编码数据):
我要为这些字段添加值:“金额”、“时间”和“时间”。如何添加从 PushNotificationPayload.apns 文件中获取此值并将其显示在通知中?
这是 PushNotificationPayload.apns 文件:
{
"aps": {
"alert": {
"body": "New Transaction\n\n",
"title": "Optional title"
},
"category": "newTransactionCategory"
},
"WatchKit Simulator Actions": [
{
"title": "Details",
"identifier": "transactionDetailsButtonAction"
}
],
"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."
}
【问题讨论】:
标签: ios swift push-notification watchkit