watch-os-2

How To Share Data with Watch OS 2 to display in WKInterfaceTable when working with CoreData

核能气质少年 提交于 2019-11-30 16:24:40
I am using WatchConnectivity to try to send data of type NSManagedObject called arrayOfOjects to the Watch. Each object has a string property called title . The InterfaceController on the Watch loads and displays and empty table - as intended because the array is empty, then when the user requests the data it is sent using the didReceiveMessage method on the phone. I am unsure how to add the dictionary array to the objectsArray to display in the WKInterfaceTable . Does anyone know how I can send the data to the watch to display in the table to make changes and sync them back with the phone ?

WatchKit Complication: get Complication data from extension delegate

隐身守侯 提交于 2019-11-30 07:34:35
I have all the data I need in my WatchKit Extension (passed from the iOS app). I used the data in the WatchKit InterfaceController to fill in a table, which works perfectly. I'm trying to figure out the best way to get that same data in my WatchKit ComplicationController . Currently, in the InterfaceController , the data gets passed in using didReceiveUserInfo : func session(session: WCSession, didReceiveUserInfo userInfo: [String : AnyObject]) { if let beachValue = userInfo["Surf"] as? String { places.append(Place(dataDictionary: ["Surf" : surfValue])) } else { print("Something went wrong") }

How To Share Data with Watch OS 2 to display in WKInterfaceTable when working with CoreData

巧了我就是萌 提交于 2019-11-29 23:35:00
问题 I am using WatchConnectivity to try to send data of type NSManagedObject called arrayOfOjects to the Watch. Each object has a string property called title . The InterfaceController on the Watch loads and displays and empty table - as intended because the array is empty, then when the user requests the data it is sent using the didReceiveMessage method on the phone. I am unsure how to add the dictionary array to the objectsArray to display in the WKInterfaceTable . Does anyone know how I can

MinimumOSVersion error while submitting Apple Watch app [duplicate]

ぐ巨炮叔叔 提交于 2019-11-29 17:20:38
This question already has an answer here: WatchKit app submission failure; MinimumOSVersion 2 answers I am trying to submit my app, but am seeing this error message: ERROR ITMS-90455 "Invalid WatchKit App Bundle. The value '2.1' for the MinimumOSVersion key in info.plist in bundle {redacted}.watchkitapp is not supported" I have updated Xcode but it still doesn't work. UPDATE: I have always the same error message with your settings. Try to set your minimum os version 2.0.Maybe 2.1 is too advanced! There is a relationship between the iOS version you're supporting on a phone, and watchOS version

How to programmatically open Apple Watch companion app from iOS app

一世执手 提交于 2019-11-29 12:07:45
I would like to give a hint to the user, that my iOS app supports the Apple Watch. So I would like to link/open the Apple Watch companion app from within my iOS app, very much similar to opening the Settings App using ( [[UIApplication sharedApplication] openURL: [NSURL URLWithString:UIApplicationOpenSettingsURLString]]; ) This shall enable the user to directly navigate to the Watch companion app to setup my app for the watch. I could not find any URL which would open the companion app in general or specific to a section of the companion app. If direct linking is not supported, I am also

WCSession.sendMessage works 50/50

假如想象 提交于 2019-11-29 09:44:35
Lately, I am working on a project is related to Watch/iPhone communication again. But my code works sometimes and doesn’t work sometimes which is kind of weird to me because I think the code should either work or not. It cannot be 50/50. Therefore, I have no idea what goes wrong. setup WCSession on iPhone: class WatchCommunicationController: NSObject, WCSessionDelegate { var session : WCSession? override init(){ // super class init super.init() // if WCSession is supported if WCSession.isSupported() { // it is supported // get default session session = WCSession.defaultSession() // set

NSUserDefaults(suiteName:) on iOS 9 and WatchOS 2 - not working?

烂漫一生 提交于 2019-11-29 07:16:17
I've done this before but nothing seems to be working. Here's my code: Saving in the iOS App let groupDefaults = NSUserDefaults(suiteName: "group.company.appSharedDefaults") groupDefaults?.setObject(theArray, forKey: "theKey") groupDefaults?.synchronize() Reading (works on iOS but not WatchOS 2) let groupDefaults = NSUserDefaults(suiteName: "group.company.appSharedDefaults") if groupDefaults!.objectForKey("theKey") != nil { textEmojiArray = NSMutableArray(array: groupDefaults!.objectForKey("theKey") as! NSArray) } else { //error } Both .entitlements files contain group.company

HKWorkoutSession: Not getting Heart Rate when screen is turned off in watchOS 2

随声附和 提交于 2019-11-29 04:46:35
I am using iOS 9 beta 4 and watchOS 2 beta 4. I can't seem to get any heart rate data when the watch screen turns black (locks). I will get a call to applicationWillResignActive and then the heart rate data just stops. It seems that the sensor is deactivating after some time as well (not green anymore), when the screen locks. Anyone else seeing this behavior? I can post my code for initing the WorkoutSession if anyone else getting heart rate data when the screen on the watch is locked. Starting in watchOS 3.0 you can add the WKBackgroundModes entry with the workout-processing value to the

How to transfer a UIImage using Watch Connectivity

三世轮回 提交于 2019-11-28 23:50:28
How can I transfer an UIImage over WatchConnecitivity from the iPhone to the Apple Watch with no user interaction on the phone, and only loads because the watch calls for it programmatically. I need this because the image processing to create the UIImage uses logic unavailable in the Watchkit API, so it must be created from the phone. I have seem some examples of Watch Connectivity using: func startSession() { session?.delegate = self session?.activateSession() } However, I am new to watch kit and iOS in general and am confused on how to use this session manager, particularly to go from the

Can I build my own networking framework (which is dependent on AFNetworking) as a watchOS2 framework?

爱⌒轻易说出口 提交于 2019-11-28 23:46:43
I've been trying to modify my project to support WatchOS2 architecture. Currently I have a networking framework that is based on AFNetworking. I've been using it with my watch app so far. Now I'm trying to build the framework for watchos/watchsimulator platforms. What I'm getting is 'SystemConfiguration/SystemConfiguration.h' file not found error for some AFNetworking classes. I know that system configuration is not one of the available system frameworks for watchOS2. And for networking apple says : Networking Support for network-based operations includes the following technologies: WatchKit