watchkit

handleWatchKitExtensionRequest not responding to openParentApplication in Watchkit Extension (Swift)

不打扰是莪最后的温柔 提交于 2019-12-04 05:31:56
I am trying to send information from my WatchKit App over to my main parent application and from what I understand I should just be able to use openParentApplication in my watchkit Extension which will be received by handleWatchKitExtensionRequest in AppDelegate.swift, but I cant seem to get handleWatchKitExtensionRequest to be triggered. I've been having some issues, so at this point I'm just trying to establish any connection at all before worrying about what information is actually passed. so currently in my Watchkit ViewController I have the following: let testDict = [ "value1" : "Test 1",

WatchKit Extension Bundle ID Unavailable

我只是一个虾纸丫 提交于 2019-12-04 04:10:18
问题 I've added a watch kit app to my iOS app and everything was working fine and running well until I wanted to share data between the two apps. Whenever I try to add the 'App Groups' capability on the watch kit extension, it tells me that my bundle ID (com.myrealappid.watchkitextension) is not available. It also informs me that 'No matching provisioning profiles found' in the General tab, and if I try to fix it, it also says that the App ID (com.myrealappid.watchkitextension) is not available.

WatchKit Simulator Won't Load App

北城以北 提交于 2019-12-04 02:59:19
问题 Originally, I thought this was an issue of the code I was writing, but I've just downloaded four or five WatchKit projects even one from Apple. All of them, fail to load. I've uninstalled Xcode, reinstalled it and still nothing. Any one else experiencing the same issue? Workarounds? Solutions? You can see in the screenshot above what the loading screen looks like. 回答1: I am already bloody sick of official Xcode 6.2 & WatchKit Simulator. It is so super flaky. Here's another fun fact, if there

WatchOS Unit Testing

让人想犯罪 __ 提交于 2019-12-04 01:36:40
I am building an app for Apple Watch and want to write a simple unit test. I looked around and didn't find a single way to add a unit testing bundle for watchOS code. Xcode supports unit tests for iOS, macOS and even tvOS but not for watchOS. Has anyone ever done it and if yes what is the trick? No, watchOS does not currently (as of watchOS 3) support unit or UI testing. What you can do is cross-compile non-watchOS-specific code to a shared library, then unit test that on another platform. 来源: https://stackoverflow.com/questions/33756093/watchos-unit-testing

Load image from URL on WatchKit

那年仲夏 提交于 2019-12-04 01:01:43
问题 Is there a more elegant solution to load an external image on the watch than the following ? let image_url:String = "http://placehold.it/350x150" dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { let url:NSURL = NSURL(string:image_url)! var data:NSData = NSData(contentsOfURL: url)! var placeholder = UIImage(data: data)! // update ui dispatch_async(dispatch_get_main_queue()) { self.imageView.setImage(placeholder) } } 回答1: NSURL is meant to be used for local files.

How to get title from WKInterfaceButton

情到浓时终转凉″ 提交于 2019-12-04 00:39:59
问题 To get title there is function: setTitle But how to get title of WKInterfaceButton as string ? I did not found anything in https://developer.apple.com/library/prerelease/ios/documentation/WatchKit/Reference/WKInterfaceButton_class/index.html 回答1: You can't get the state of any WKInterface UI element like buttons (WKInterfaceButton) label (WKInterfaceLabel) etc. I think this is designed by Apple like this because it involve under the hood communication between the extension running on your iOS

What is the very reason for WatchKit2 error code 7007 “session on paired device is not reachable”

孤者浪人 提交于 2019-12-04 00:12:49
I am developing a glance view for my Apple WatchOS2 app. I'am currently didn't fully understand the prequisites for a stable WatchConnectivity connection now. I have the strange situation, that in the simulator my ComplicationController could successfully a sendMessage Request. When I try to look at my glance, the sendMessage request failed with: Error Domain=WCErrorDomain Code=7007 "WatchConnectivity session on paired device is not reachable." UserInfo={NSLocalizedDescription=WatchConnectivity session on paired device is not reachable. I have to admit, that I didn't start my app on the

How to trigger notifications using WatchKit

十年热恋 提交于 2019-12-03 22:44:06
In the WatchKit developer guide , there are instructions on how to render custom notifications and it also says: Apps are not required to do anything to support notifications. The system provides a default notification interface that displays the alert message from the notification. However, apps can customize the notification interface and include custom graphics, content, and branding. I can get local notifications to trigger banner alerts on the phone, but they don't happen on the WatchKit app. I have tried debugging using all of the targets: iOS app Watch app Watch Glance Watch custom

NSXMLParserErrorMessage - Could not open data stream

风流意气都作罢 提交于 2019-12-03 22:28:38
I'm stuck in a weird problem. I try to parse an XML-File from a non-HTTPS Webserver for the Apple Watch. Its working great with WatchKit 2.0 and iOS 9.1 in the Xcode Simulator, as soon as try to build it on my Watch, its not working anymore... I also have set the ATS as followed in all Info.plist files: <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> While debugging I found the following error: [0] (null) "NSXMLParserErrorMessage" : "Could not open data stream" import Foundation import WatchKit class parkingXMLParser : NSObject, NSXMLParserDelegate{

WKInterfaceButton event handling in WKInterfaceTable

拥有回忆 提交于 2019-12-03 21:40:53
I have a WKInterfaceTable table view with a WKInterfaceButton . How can I add a target action to the button from the table view. As there is no tag property I am not able to handle it. If your WKInterfaceButton is contained within a row controller, here is one method to determine which row's button was tapped: Add your WKInterfaceButton to the row controller and use interface builder to connect the button's action to your row controller class Add a property to your row controller that allows you to reference your data (for example, a weak reference to your data or a tag) Add a property to your