My requirement is to open a parent application in the background from the Watch-kit extension using Objective-C. I am using Xcode8.0. The Watch-kit extension lacks an api method like openParentApplication
.
Could anyone help me with the available api or sample code?
the openParentApplication
method has been deprecated from watchOS 2.0, you cannot access the application in background.
To access the parent application from watch app, you can use the WCSessionDelegate
methods
you can use the tutorial here for reference apart from that you may use
func sendMessage(_ message: [String : Any],
replyHandler: (([String : Any]) -> Void)?,
errorHandler: ((Error) -> Void)? = nil)
to communicate with the iphone app instantly if it is alive
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.