watch-os-2

watchOS 2: haptic feedback in background

穿精又带淫゛_ 提交于 2019-11-28 23:27:00
I think I know the answer to this question already, but I wanted to ask just to be thorough. Consider the Apple Watch built-in Maps app. When you're using turn-by-turn directions, when it's time to turn left or right, the watch plays a custom haptic pattern - even though the screen is off and the app is backgrounded. Another example is while you're doing a workout - if you've set a goal, you'll get a light tap on your wrist when you get 50% there and 100% there, even if you're not looking at the watch at the time (screen off, app backgrounded). In watchOS 2, is there any way for us 3rd party

Call ExtensionDelegate to create/refresh data for Complication

一笑奈何 提交于 2019-11-28 14:15:05
All my data creation is done in the ExtensionDelegate.swift . The problem is ExtensionDelegate.swift doesn't get called before the function getCurrentTimelineEntryForComplication in my ComplicationController.swift . Any ideas? Here is my code and details: So my array extEvnts is empty in my ComplicationController.swift : func getCurrentTimelineEntryForComplication(complication: CLKComplication, withHandler handler: ((CLKComplicationTimelineEntry?) -> Void)) { let extEvnts = ExtensionDelegate.evnts } Because my ExtensionDelegate.swift hasn't gotten called yet, which is what creates the data for

Using WCSession with more than one ViewController

こ雲淡風輕ζ 提交于 2019-11-28 12:11:54
I found many questions and many answers but no final example for the request: Can anyone give a final example in Objective C what is best practice to use WCSession with an IOS app and a Watch app (WatchOS2) with more than one ViewController . What I noticed so far are the following facts: 1.) Activate the WCSession in the parent (IOS) app at the AppDelegate: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //Any other code you might have if ([WCSession isSupported]) { self.session = [WCSession defaultSession]; self.session.delegate

How big can the payload be when sending data via WatchConnectivity?

隐身守侯 提交于 2019-11-28 06:32:42
When sending data using the WatchConnectivity framework, either from the phone to the watch or vice-versa, how big can the payload be before the framework gives me the WCErrorCodePayloadTooLarge error? I couldn't find the answer on Apple's documentation, and there doesn't seem to be much information on this on the internet at this time (in fact, googling WCErrorCodePayloadTooLarge gives me just 4 results). Has anyone tested to try to find the answer to this? If this question doesn't get an answer, I will try to do it myself and post the results. So far, all the information I have is that it

What is the flow for updating complication data for Apple Watch?

大憨熊 提交于 2019-11-28 04:11:46
I've been following a lot of tutorials on the internet to learn how to set up the complication. I have no problem getting the complication set up as expected. Until the initial timeline entries expire. After 12 hours, I do not know how to update it to keep the complication live. I'll share everything I have below and hopefully somebody can help fill me in. Here, I create the variables for my data that I want to display on the complication. struct data = { var name: String var startString: String var startDate: NSDate } The following array is a container for this data. var dataArray = [data]

Swift watchOS 2 - CMSensorDataList

点点圈 提交于 2019-11-28 03:59:03
问题 Short: I don't know how to extract the CMRecordedAccelerometerData from the CMSensorDataList after getting one from the CMSensorRecorder. Apple isn't providing any documentation, yet. Maybe someone has a hint for me? ;) func startMovementDetection(){ var accDataList = self.cmSensorRecorder!.accelerometerDataFrom(self.startDate, to: NSDate()) as CMSensorDataList CMRecordedAccelerometerData() //that's the class i want to extract from CMSensorDataList } Okay, problem solved with this one here:

App installation failed due to application-identifier entitlement

女生的网名这么多〃 提交于 2019-11-28 02:39:48
I am unable to install a watchOS 2 WatchKit app due to an application-identifier entitlement. This happened after turning on App Groups in the Capabilities tab. Full error: App installation failed This application's application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed. This is running the app in debug mode on a physical device. Running just the iOS app works fine. I have turned App Groups off again and removed the entitlements files that were added, but same error. I had this problem with an iPhone app, and

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

僤鯓⒐⒋嵵緔 提交于 2019-11-28 00:46:00
问题 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(

Using Core Data with watchOS 2.0

依然范特西╮ 提交于 2019-11-27 21:06:12
I made an iOS/Apple Watch app with WatchKit 1.0 that uses a shared group container and a custom framework to access the same Core Data store. Now, in the transition guide for watchOS 2.0, Apple says this: If your existing Watch app and iOS app use a shared group container or iCloud to exchange data, you must change the way you exchange that data in watchOS 2. Because the WatchKit extension now runs on Apple Watch, the extension must exchange data with the iOS app wirelessly. You can do that using an NSURLSession object or using the Watch Connectivity framework, which supports bidirectional

watchOS 2: haptic feedback in background

不羁的心 提交于 2019-11-27 14:47:34
问题 I think I know the answer to this question already, but I wanted to ask just to be thorough. Consider the Apple Watch built-in Maps app. When you're using turn-by-turn directions, when it's time to turn left or right, the watch plays a custom haptic pattern - even though the screen is off and the app is backgrounded. Another example is while you're doing a workout - if you've set a goal, you'll get a light tap on your wrist when you get 50% there and 100% there, even if you're not looking at