【问题标题】:How to refresh watchkit interface controller upon receiving push notification如何在收到推送通知后刷新 watchkit 界面控制器
【发布时间】:2015-09-10 14:11:57
【问题描述】:

我的应用在收到推送通知后更新其 viewController,在 iOS 应用中,我使用 appDelegate 内的方法 didReceiveRemoteNotification 来检查远程通知并根据通知类型和附加数据更新显示的 viewController

现在我需要做同样的过程来更新手表扩展上的主界面控制器

有人知道怎么做吗?

【问题讨论】:

    标签: ios objective-c push-notification watchkit


    【解决方案1】:

    您可以使用这些方法:

    - (void)handleActionWithIdentifier:(nullable NSString *)identifier forRemoteNotification:(NSDictionary *)remoteNotification; // when the app is launched from a notification. If launched from app icon in notification UI, identifier will be empty
    - (void)handleActionWithIdentifier:(nullable NSString *)identifier forLocalNotification:(UILocalNotification *)localNotification; // when the app is launched from a notification. If launched from app icon in notification UI, identifier will be empty
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-12
      • 2015-10-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多