watchos-2

Open Parent Application (WatchOS 2.x+)

谁说胖子不能爱 提交于 2019-12-11 10:07:24
问题 I am trying to get an update from the parent app, but I don't want to bring the parent app to the foreground when the request is sent from the Apple Watch. I ultimately would like to bring the parent app to a background state, have it run it's required method and send it back to the watch. Specifically, is there a way to open the parent app and have it reside temporarily in a background state from WatchOS 2.0+? I have looked into this: [WKInterfaceController openParentApplication:

Phone call from Apple Watch with openSystem API?

∥☆過路亽.° 提交于 2019-12-11 09:07:53
问题 As I watched the WWDC 2015 session video "Introducing WatchKit for watchOS 2" (at 13:29), I saw that it is possible to make phone calls directly on Apple Watch with the openSystem API. How can I use this API in Swift? 回答1: You can use the openSystemURL method, which is available on the shared WKExtension object. Pass a tel: URL to this method to initiate a phone call. if let telURL=NSURL(string:"tel:5553478") { let wkExtension=WKExtension.sharedExtension() wkExtension.openSystemURL(telURL) }

Location detection in WatchOS simulator has been failed

我怕爱的太早我们不能终老 提交于 2019-12-11 06:27:44
问题 How to simulate a location for watchOS simulator? using with request - (void) requestLocation { locationManager = [CLLocationManager new]; locationManager.delegate = self; [locationManager requestWhenInUseAuthorization]; [locationManager requestLocation]; } I always catch an error: - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error { // Error here if no location can be found } The error is NSError * domain: @"kCLErrorDomain" - code: 0 0x7a867970 回答1: In

How can I awake my iPhone app in the background to run a function and return the results to Apple Watch?

孤人 提交于 2019-12-11 04:26:33
问题 I have a table in my Apple Watch app that is populated by data from the iPhone app. On the iPhone app, I need to get this data from the internet. On the phone, the function is called retrieveData(). I also have a function called sendToWatch() that sends this data to the watch when the phone app is open. I'd like to find a way to run retrieveData() and sendToWatch() without needing to open the phone app. I've looked into this for the past few hours, and it seems very complicated. I've tried

NSExtensionPointIdentifier error only on real device

荒凉一梦 提交于 2019-12-11 03:28:41
问题 I am getting the following error when I try to run my Apple Watch app on my device: error: WatchKit App doesn't contain any WatchKit Extensions. Verify that the value of NSExtensionPointIdentifier in your WatchKit Extension's Info.plist is set to com.apple.watchkit. The value of NSExtensionPointIdentifier is set correctly. Has anyone else experienced this error? 回答1: I fixed the issue by changing the deployment target to 9.0 in the Extension's Build Settings. 回答2: Every time I met same

Complication won't update

左心房为你撑大大i 提交于 2019-12-10 18:50:28
问题 I have a very simple complication with a random number. But my number won't update. Everytime I look on my watch it's the same. Only if I reinstall the complication (reinstalling apple watch app) I'm getting a new number. I have set update to 1 second. Anyone an idea what could be wrong? func getCurrentTimelineEntryForComplication(complication: CLKComplication, withHandler handler: ((CLKComplicationTimelineEntry?) -> Void)) { handler(CLKComplicationTimelineEntry(date: NSDate(),