watchos-3

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,

TouchEvents in watchOS 3 SpriteKit?

a 夏天 提交于 2020-01-23 07:41:35
问题 When using SpriteKit in watchOS 3, how do you handle the touch events? I am porting the SpriteKit games from iOS and the codes below won't work. Or you have to control the WKInterfaceController somehow? override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {} override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {} override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {} override func touchesEnded(_ touches: Set<UITouch>, with

TouchEvents in watchOS 3 SpriteKit?

落爺英雄遲暮 提交于 2020-01-23 07:41:34
问题 When using SpriteKit in watchOS 3, how do you handle the touch events? I am porting the SpriteKit games from iOS and the codes below won't work. Or you have to control the WKInterfaceController somehow? override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {} override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {} override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {} override func touchesEnded(_ touches: Set<UITouch>, with

swift WatchConnectivity running in background - ApplicationContext is not running all the time

浪尽此生 提交于 2020-01-07 05:11:14
问题 I want to know a better way to send (with iPhone) message to Watch (in background). Currently i use: session.update(applicationContext: package, completion: nil) for sending messages to Watch and func didReceivedApplicationContext(applicationContext:[String : Any]) to receive messages in Watch. The problem is that as is said in documentation "The system will transfer content at opportune times" and i can't control those "oportune times". At this time, i check in iPhone class the state of

watch OS3 , UIRequiredDeviceCapabilities issue during ITC review

江枫思渺然 提交于 2020-01-01 11:00:35
问题 During testflight review, I run into the following issue: From Apple 2. 3 PERFORMANCE: ACCURATE METADATA Performance - 2.3 We were unable to install the app extension on an Apple Watch running OS3. The UIRequiredDeviceCapabilities key in the Info.plist is set in such a way that the app will not install on an Apple Watch running OS3. Next Steps Please check the UIRequiredDeviceCapabilities key to verify that it contains only the attributes required for your app features or the attributes that

Read Heart Rate in Apple Watch Series 3 without creating an app on the Watch

£可爱£侵袭症+ 提交于 2019-12-24 19:36:53
问题 Is it possible to read/sync the Heart Rate data from Apple watch series 3 without creating a watch app? I want my iPhone app to read data directly from the Apple Watch without having to create an app for the watch too. 回答1: Apple Watch syncs all of its recorded heart rate data (automatically sampled every five minutes while wearing, and more frequently during workout sessions) to the HealthKit store on the companion iPhone. So you can create an iOS app that (with the user's permission) reads

Bitcode WatchOS3 - how to generate

北城以北 提交于 2019-12-23 17:13:47
问题 I am attempting to upload a watchOS3 app to the apple store, however I received a rejection (from apple) thats similar the below Invalid Executable - The executable 'someWatch Extension' does not contain bitcode. Once these issues have been corrected, you can then redeliver the corrected binary. How can I resolve this? It seems like bitcode is mandatory as there is no longer a build setting in Xcode for my watch application to simply "Enable Bitcode=No". I have also tried looking into running

swift how to share data between Watch and iPhone on background

放肆的年华 提交于 2019-12-23 02:46:40
问题 I have a functional application for sharing the data between iPhone and Watch (share text) and I want to make it work even when the watch is set on background (send data from iPhone to Watch when Watch is on background). I read a lot about how to make this but nothing seemd to be ok for my application. Please add the code to make application work as I said before. Or give me some source which fit with this app. Thank you! Code for iPhone: import UIKit import WatchConnectivity class

URLSessionTask runs always into an error

怎甘沉沦 提交于 2019-12-22 10:11:47
问题 In my ExtensionDelegate I'm starting a URLSessionTask with following code: func scheduleNextURLSessionTask() { let backgroundConfigObject = URLSessionConfiguration.background(withIdentifier: "myIdentifier") let backgroundSession = URLSession(configuration: backgroundConfigObject, delegate: self, delegateQueue: nil) let retrieveTask = backgroundSession.dataTask(with: URL(string: "https://api.wedtec.net/cryptocoins/index.php?bitcoin&simple")!) retrieveTask.resume() } My ExtensionDelegate