2
  • I have created an iOS app then i added new Watch-kit app target without notifications scene.

  • Previously i did not need to show notifications.But now i want to add notifications scene also.i want to add "Notifications Scene" in my existing Watch-kit app.

  • Will i have to create new target ? or i will have to add notifications classes and interface file manually?

I have searched on SO and other developers forums , i did not get any satisfactory answer.

4

1 回答 1

1

不,您不必创建另一个目标来处理通知。您需要做的就是将Notification Interface Controller对象添加到您的Interface.stroyboard文件以及.apns您需要创建的文件,如果您在项目创建期间选择了该选项,则该文件将由 Xcode 创建。

如果您正在实现动态通知场景,请Notification Interface Controller从对象库中添加一个对象并选择该选项。Has Dynamic Interfaces这将自动将另一个场景添加到您的 stroyboard。

查看Apple 文档以获取详细信息以及在 Watch App 中设置远程通知的教程。虽然本教程没有单独添加通知场景,但您会明白https://www.natashatherobot.com/watchkit-actionable-notifications

于 2016-02-29T13:49:38.843 回答