apple-watch-complication

Apple Watch Complication not updating in background

家住魔仙堡 提交于 2020-12-31 06:42:29
问题 I have an Apple Watch complication that initializes correctly and show the data I am expecting. However, when the NSDate returned in my getNextRequestedUpdateDateWithHandler method triggers a refresh, the only method in my delegate that gets called again is the getNextRequestedUpdateDateWithHandler method (I set breakpoints at every method to determine this). I would have expected requestedUpdateDidBegin to get called when the requested update date occurs, but that doesn't seem to be the case

Apple Watch Complication not updating in background

坚强是说给别人听的谎言 提交于 2020-12-31 06:40:13
问题 I have an Apple Watch complication that initializes correctly and show the data I am expecting. However, when the NSDate returned in my getNextRequestedUpdateDateWithHandler method triggers a refresh, the only method in my delegate that gets called again is the getNextRequestedUpdateDateWithHandler method (I set breakpoints at every method to determine this). I would have expected requestedUpdateDidBegin to get called when the requested update date occurs, but that doesn't seem to be the case

WatchOS3 Complication that launches App

杀马特。学长 韩版系。学妹 提交于 2020-12-24 14:27:53
问题 I would like to create a complication for watchOS 3 that will simply launch my App. I have used XCode to create the ComplicationController: class ComplicationController: NSObject, CLKComplicationDataSource { // MARK: - Timeline Configuration func getSupportedTimeTravelDirections(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimeTravelDirections) -> Void) { handler([.forward, .backward]) } func getTimelineStartDate(for complication: CLKComplication,

WatchOS3 Complication that launches App

拟墨画扇 提交于 2020-12-24 14:27:21
问题 I would like to create a complication for watchOS 3 that will simply launch my App. I have used XCode to create the ComplicationController: class ComplicationController: NSObject, CLKComplicationDataSource { // MARK: - Timeline Configuration func getSupportedTimeTravelDirections(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimeTravelDirections) -> Void) { handler([.forward, .backward]) } func getTimelineStartDate(for complication: CLKComplication,

How to update Watch Complication only when the watch is awake, to not use up the daily budget

我与影子孤独终老i 提交于 2020-05-10 18:49:33
问题 I have a server that keeps 2 booleans. These booleans change every 15 seconds. Whenever I wake my Apple Watch, I want the complication to show the current state. How can I do it withough exhausting the budget early on? The best way would be to fetch the newest state into the complication whenever I wake my watch. The only possible way I see would be to poll the server (either directly or via my phone) every 15 seconds. The problem is that I'd soon use up all the allotted time. It would be

Scheduling complication updates

本秂侑毒 提交于 2020-02-28 09:46:42
问题 I have a custom complication on Apple Watch that I am trying to get to update once an hour. Each hour it should ping an API endpoint and if the data has changed from the last check, the complication should be updated. Here is what I currently have that only seems to work once in a blue moon. When it DOES work, it does indeed ping my server and update the complication. It appears WatchOS just isn't calling my scheduled tasked once per hour. Is there a better standard practice that I'm missing?

Scheduling complication updates

北慕城南 提交于 2020-02-28 09:46:17
问题 I have a custom complication on Apple Watch that I am trying to get to update once an hour. Each hour it should ping an API endpoint and if the data has changed from the last check, the complication should be updated. Here is what I currently have that only seems to work once in a blue moon. When it DOES work, it does indeed ping my server and update the complication. It appears WatchOS just isn't calling my scheduled tasked once per hour. Is there a better standard practice that I'm missing?

Get Data to Complication: ExtensionDelegate not Called

五迷三道 提交于 2020-01-22 20:18:07
问题 (It looks like this issue has been encountered by others in previous weeks, but there haven't been any solutions that I've found.) I'm trying to do a really basic thing: Get data from either my iOS app or my Watch app to my Complication Controller. I am turning out to be way less capable of getting this done than I thought. watchOS 2 Transition Guide indicates that I should "[fetch] the needed data from the extension delegate" using the following code: ExtensionDelegate* myDelegate = [

Setting tintColor for Apple Watch complication

心已入冬 提交于 2019-12-24 17:12:20
问题 I am trying to set the header text color for a Modular Large complication. I have already customized the watch face to use Multicolor. However, when I build and run this code, the header text color is still white (which is the default). Why isn't the color updating? private func templateForClassModularLarge(className: Schedule) -> CLKComplicationTemplateModularLargeStandardBody { let template = CLKComplicationTemplateModularLargeStandardBody() let headerTextProvider = CLKSimpleTextProvider

how to wake up iOS parent app with sendMessage from complicationController

好久不见. 提交于 2019-12-22 12:31:50
问题 I am trying to wake up the iOS parent app by sending a message from watchkit extension. This though does only work when below sendMessage function is called from the watchApp / ViewController. When it is called from ComplicationController, the message is sent, but the iOS parent app does now wake up. Any advice appreciated. (please any code reference in Swift) Here the simplified code: In AppDelegate and ExtensionDelegate: override init() { super.init() setupWatchConnectivity() } private func