Apple Watch和openParentApplication在后台

DaS*_*lva 5 ios apple-watch watchkit

我正在实施一个苹果手表.在我的Watchkit扩展中,我使用该方法与"主应用程序"进行通信.

    [WKInterfaceController openParentApplication:applicationData reply:^(NSDictionary *replyInfo, NSError *error) {}];
Run Code Online (Sandbox Code Playgroud)

根据Apple 文档,该应用程序可以在后台处理请求.

When you call the openParentApplication:reply: method, iOS launches or 
wakes up the parent app in the background and calls the
application:handleWatchKitExtensionRequest:reply:method of its app delegate.
Run Code Online (Sandbox Code Playgroud)

但是我的应用程序总是变为活动状态,即使我在方法中没有代码,handleWatchKitExtensionRequest

任何提示,如果可能的话?

提前致谢

lvp*_*lvp 2

根据苹果开发者在苹果开发者论坛上的官方回应,这是 WatchKit Framework Beta 2 中的错误。

https://devforums.apple.com/message/1082689#1082689

需要澄清的一件事是,iPhone 应用程序是在后台启动的。目前,在模拟器中,该应用程序正在前台启动。这不会是设备上的体验。该文档特别指出,“调用该方法会导致 iOS 在后台启动应用程序......”。

(帖子编号6)

顺便说一句,昨天 Beta 3 发布了,也许它已经修复了。

更重要的是,如果 iPhone 被锁定,您的 iOS 应用程序也会在后台启动。