[英]Detect if iOS app is in foreground from WatchKit extension
Since + openParentApplication:reply:
only opens the iOS app in the background, is there a way to detect if the app has been opened by the user and adapt the extension's behaviour accordingly? 由于+ openParentApplication:reply:
仅在后台打开iOS应用程序,有没有办法检测用户是否已打开该应用程序并相应地调整扩展程序的行为?
Edit: Also, how could a mechanism work that notifies the extension once the app's status changes? 编辑:此外,一旦应用程序状态更改,一种机制如何通知扩展程序?
您可以检查[[UIApplication sharedApplication] applicationState]并在回复中发送一些信息,以指示您的运行方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.