- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在实现 Apple Watch。在我的 Watchkit 扩展中,我使用该方法与“主应用程序”通信。
[WKInterfaceController openParentApplication:applicationData reply:^(NSDictionary *replyInfo, NSError *error) {}];
根据苹果documentation ,应用可以在后台处理请求。
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.
但是我的应用程序始终处于事件状态,即使方法中没有代码,handleWatchKitExtensionRequest
有什么建议吗?
提前致谢
最佳答案
根据 Apple Developer Forum 上 Apple dev 的官方回复,这是 WatchKit Framework Beta 2 中的错误。
https://devforums.apple.com/message/1082689#1082689
And just to be clear about one thing, the iPhone app is lauched in the background. In the simulator currently the app is being launched in the foreground. This will not be the experience on device. The documentation specifically says, "Calling the method causes iOS to launch the app in the background ...".
(帖子编号 6)
顺便说一句,昨天 Beta 3 发布了,也许它已经修复了。
此外,如果 iPhone 将被锁定,您的 iOS 应用程序也将在后台启动。
关于ios - Apple Watch 和 openParentApplication 在后台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27531937/
在我的 watch 应用程序中,我使用 openParentApplication 与父应用程序通信,但这并不总是可靠的,尤其是当我有一段时间没有使用父应用程序时。看来这不是唤醒父应用进行通信。但是,
我正在尝试使用 openParentApplication 从服务器请求数据并在 watch 扩展中使用它,但是当主应用程序未在前台运行时我没有得到任何回复。当主应用程序在前台运行时,一切正常。 最佳
我的 watch 应用程序使用 openParentApplication 从其 WatchKit 扩展请求数据。它从 watch 应用程序的主页 init() 开始: class HomePage
我目前有一个问题。我想要的行为:如果我打开我的 WatchKit 应用程序,我会调用“openParentApplication”。我收到了我想要的数据。但是如果我在真实设备上测试,它就不起作用,因为
在我的应用程序中,我从 iPhone 到 Apple Watch 以及从 Apple Watch 到 iPhone 进行通信。 对于 Apple Watch 上的 Tableview,当应用程序在 i
我在 WKInterfaceController 和 iOS 中调用 openParentApplication 方法等待来自服务器的响应。然后我想再次使用openParentApplication在
打开 Apple Watch 应用程序后,我用 openParentApplication:reply: 唤醒 iPhone 应用程序以获取当前位置。正如苹果所说 here ,您应该避免在 Watch
我正在尝试通过 Watchkit 操作打开 Swift iOS 应用程序,但我无法找到 openParentApplication 方法 // Register notifications in i
我正在实现 Apple Watch。在我的 Watchkit 扩展中,我使用该方法与“主应用程序”通信。 [WKInterfaceController openParentApplicatio
我正在开发一个 Apple Watch 应用程序,它使用 openParentApplication:reply: 方法与其父应用程序通信。 父应用程序与 Web 服务通信,并通过使用包含数据的 NS
我有一个 watch 应用程序需要与父应用程序通信以获取一些信息。这应该只在口袋里使用 watch 和手机时发生。它曾经像这样工作: 在 watch 上的 InterfaceController 中:
我正在尝试实现 Apple Watch 扩展。我需要调用我的 iPhone 应用程序类方法来触发 Web 请求。我在苹果文档中看到了这个方法,我也在尝试同样的方法。但是这个方法没有调用 - (void
在更新到 Xcode 7 之后,我刚刚将我的项目更新到 Swift 2.0,但我的 watch 扩展遇到了问题。 我想要 watchOS 1 目标和 watchOS 2 目标,所以我为 watchOS
我正在尝试将信息从我的 WatchKit 应用程序发送到我的主要父应用程序,据我所知,我应该只能使用 openParentApplication在我的 watchkit 扩展中,handleWatch
情况:我在 Watch 应用程序中使用 openParentApplication 来调用主应用程序中的 handleWatchKitExtensionRequest。这在模拟器中运行良好,并且在 i
当我激活我的 WatchApp InterfaceController 时。它所做的第一件事是尝试通过调用“OpenParentApplication”方法来唤醒 parentApplication(
我正在开发一个在 watch 和 iOS 父应用程序之间进行通信的应用程序。它通过打开 WatchKit 扩展将数据发送到父应用程序。我知道 openParentApplication:reply 在
我正在使用 openParentApplication:和 handleWatchKitExtensionRequest:请求并发送一个 NSNumber 对象,该对象包含来自核心位置 locatio
我为 Apple Watch 创建了一个较小的项目,以与其运行的父应用程序进行通信。 所以我在我现有的 iOS 项目中创建了一个 Watch 套件扩展,但是当它从 Watch 端调用 openpare
更新到 Xcode 7 beta 后,在运行代码行“WKInterfaceController.openParentApplication”时,我收到以下错误消息:“‘openParentApplic
我是一名优秀的程序员,十分优秀!