xcode Apple Watch 上的推送通知
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28971506/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Push Notifications on Apple Watch
提问by natuslaedo
My app is waiting for review by Apple to be released and there is no setting to support Apple Watch inside my app. My question is: Is the notifications which come to device in which my app is installed will be automatically displayed also on Apple Watch without making any update/change for my app (Like adding Apple Watch as target)? If so, will push notification actions of my iOS app also be available (and functional of course) on Apple Watch?
我的应用程序正在等待 Apple 发布审核,并且我的应用程序中没有支持 Apple Watch 的设置。我的问题是:安装我的应用程序的设备上的通知是否也会自动显示在 Apple Watch 上,而无需对我的应用程序进行任何更新/更改(例如将 Apple Watch 添加为目标)?如果是这样,我的 iOS 应用程序的推送通知操作是否也可以在 Apple Watch 上使用(当然也可以使用)?
回答by Cornelius
Your notifications will show up on the Apple Watch automatically:
您的通知将自动显示在 Apple Watch 上:
If your iOS app supports local or remote notifications, Apple Watch displays those notifications at appropriate times. When one of your app's local or remote notification arrives on the user's iPhone, iOS decides whether to display that notification on the iPhone or on Apple Watch.
如果您的 iOS 应用程序支持本地或远程通知,Apple Watch 会在适当的时间显示这些通知。当您的应用程序的本地或远程通知之一到达用户的 iPhone 时,iOS 会决定是在 iPhone 上还是在 Apple Watch 上显示该通知。
Official reference: Apple Watch Programming Guide - Notification Essentials