Watch-kit:将 "Notifications Scene" 添加到现有 watchkit 应用 ios
Watch-kit : adding "Notifications Scene" to existing watchkit app ios
我创建了一个 iOS 应用,然后添加了新的 Watch-kit 应用目标
没有通知的场景。
以前我不需要显示 notifications.But 现在我想显示
添加通知场景also.i想添加”通知
我现有的 Watch-kit 应用程序中的场景"。
- 我需要创建新目标吗?或者我将不得不添加
手动通知 类 和接口文件?
我搜索过 SO 和其他
开发者论坛,我没有得到任何满意的答案。
不,您不必创建另一个目标来处理通知。您需要做的就是将 Notification Interface Controller
对象添加到您的 Interface.stroyboard
文件以及您需要创建的 .apns
文件,如果您有 select在项目创建过程中编辑了选项。
如果要实现动态通知场景,请从对象库中添加一个 Notification Interface Controller
对象并 select 选项 Has Dynamic Interfaces
。这会自动将另一个场景添加到您的故事板上。
勾选Apple Documentation for details and Tutorial to set up remote notification in Watch App. Though the tutorial doesn't add the notification scene separately but you will get the idea https://www.natashatherobot.com/watchkit-actionable-notifications
我创建了一个 iOS 应用,然后添加了新的 Watch-kit 应用目标 没有通知的场景。
以前我不需要显示 notifications.But 现在我想显示 添加通知场景also.i想添加”通知 我现有的 Watch-kit 应用程序中的场景"。
- 我需要创建新目标吗?或者我将不得不添加 手动通知 类 和接口文件?
我搜索过 SO 和其他 开发者论坛,我没有得到任何满意的答案。
不,您不必创建另一个目标来处理通知。您需要做的就是将 Notification Interface Controller
对象添加到您的 Interface.stroyboard
文件以及您需要创建的 .apns
文件,如果您有 select在项目创建过程中编辑了选项。
如果要实现动态通知场景,请从对象库中添加一个 Notification Interface Controller
对象并 select 选项 Has Dynamic Interfaces
。这会自动将另一个场景添加到您的故事板上。
勾选Apple Documentation for details and Tutorial to set up remote notification in Watch App. Though the tutorial doesn't add the notification scene separately but you will get the idea https://www.natashatherobot.com/watchkit-actionable-notifications