watchos-2

When to call activateSession() on WCSession object

懵懂的女人 提交于 2019-12-12 11:35:49
问题 I wonder at what point one would call activateSession() on a WCSession object on the watch and on the iOS device. In the documentation it says: Always assign a delegate and activate your session before calling any session-related methods. The session must be configured and activated before sending messages or obtaining information about the state of the connection. At first thought I put my code to initialise the session: if (WCSession.isSupported()) { session = WCSession.defaultSession()

Add Parse.com 1.11.0 to watchOS 2

泄露秘密 提交于 2019-12-12 11:35:37
问题 In the Parse SDK update to 1.11.0 it says it supports watchOS and tvOS. I was wondering how I can add the frameworks to my watchOS app using Cocoapods. The pod file contains pod 'Parse' and I have run pod update then pod install but when I add a bridging header to the watchOS 2 Extension it says file not found. Do you know what I should be doing? Thank you 回答1: It seems like the QuickStart instructions have not been updated for watchOS 2. I couldn't find any information in the announcement

Keep Apple Watch awake

耗尽温柔 提交于 2019-12-12 10:47:10
问题 I'm building an Apple Watch app which is controlled using motion. Right now, I'm looking for a way to keep the app awake without the user interacting with the screen. Any ideas? 回答1: You can't keep Apple Watch awake programmatically. You can change the end-user settings in Apple Watch settings app or in the Apple Watch app on iPhone, but there is no way to do this programmatically and with coding. The screen will be turned off after a certain amount of time (which is adjustable in Apple Watch

Implementing Core Data to watchOS 2.0

拜拜、爱过 提交于 2019-12-12 10:23:25
问题 I am pretty new to WatchKit, and I am trying to add Core Data to my WatchKit extension. So far I have created a Data Model in my WatchKit extension, but I am stuck on implementing the rest of the Core Data stack. Is the process of creating Core Data models and initializing the Core Data stack identical to iOS or are there any differences I should be aware of? Also, do I initialize the Core Data stack in the ExtensionDelgate.swift or should I initialize it somewhere else? 回答1: The process of

Watchkit Complication and location updates?

徘徊边缘 提交于 2019-12-12 06:02:18
问题 I'm trying to write a complication that uses location data. I can get the location data in the complication controller but it never seems to work properly due to the results coming back asynchronously. What is the best way to update a complication with location specific data? I'm thinking that it's not a good idea to get the location in the complication (even though you can). 回答1: You should retrieve and cache the location data before the complication data source needs it. The job of your

Can I test local notifications on the WatchOS 2 Simulator?

孤街醉人 提交于 2019-12-12 05:24:30
问题 I am Googling a lot to find out way to check local notifications on the WatchOS Simulator because I don't have an iWatch. Right now I have implemented local notification but due some reason notification is shown on iPhone simulator but not on iWatch (WatchOS 2) simulator. I have added following code in applicationDidFinishLaunchingWithOptions: UIMutableUserNotificationAction *action1; action1 = [[UIMutableUserNotificationAction alloc] init]; [action1 setActivationMode

HomeKit show no homes in WatchOS 2

走远了吗. 提交于 2019-12-12 03:59:19
问题 WatchKit app using WatchOS2 with HomeKit capabilities, but HMHomeManager return with no homes (after homeManagerDidUpdateHomes is called). The corresponding iOS app works fine, and show the homes. 回答1: It does work on real watch but not in simulator 来源: https://stackoverflow.com/questions/32129849/homekit-show-no-homes-in-watchos-2

Troubleshooting Submitting Watch App to App Store - Code Signing

三世轮回 提交于 2019-12-12 03:37:49
问题 I'd appreciate if anyone can help me with any or all of my errors I'm getting from trying to upload my new Watch App to the App Store (I already have a current iOS app). First I've followed this tutorial pretty close : Submitting Apple Watch Apps and it seems I'm getting hung up on a lot of code signing and plist problems. So for the first one I don't understand how I would have 2 extensions like this screenshot: The #2 error I've fixed, so I don't know why its still showing. #3 I don't know

Using three arrays to populate complication timeline

梦想与她 提交于 2019-12-12 02:59:55
问题 I have three arrays that have the data to populate the complication timeline with entries. When I scroll through time travel, the complication does not change so I know I must be doing something wrong. func getTimelineEntriesForComplication(complication: CLKComplication, afterDate date: NSDate, limit: Int, withHandler handler: (([CLKComplicationTimelineEntry]?) -> Void)) { for headerObject in headerArray! { for body1Object in body1Array! { for body2Object in body2Array! { let

Is there REALLY no way to play short sounds on Apple watch without a UI?

时光怂恿深爱的人放手 提交于 2019-12-11 13:56:48
问题 As a learning exercise I decided to write a Simon game for Apple Watch (iOS 9.3, WatchKit 2.0). I created 4 short piano note sounds in GarageBand. I converted them to MP3 files in Audacity, only to find that Apple Watch doesn't support MP3. Ok, great. I need to convert them to WAV or CAF files. Sigh... Anyway, looking into it, it looks like the only way to play any sounds at all is to display a media controller on the watch. (Using either presentMediaPlayerControllerWithURL:options:completion