watchkit

SMS WatchKit multiple number delimiter

我只是一个虾纸丫 提交于 2019-11-28 11:53:13
问题 I'm having a little trouble getting my WatchKit App to pre-compose an SMS message to multiple recipients (via the Apple Watch message app). let messageBody = "hello test message" let urlSafeBody = messageBody.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLHostAllowedCharacterSet()) if let urlSafeBody = urlSafeBody, url = NSURL(string: "sms:8888888888&body=\(urlSafeBody)") { WKExtension.sharedExtension().openSystemURL(url) My question is, if you have multiple phone

How to send data from iphone to watchkit in swift

微笑、不失礼 提交于 2019-11-28 11:50:47
I am doing a sample project in which i like to send data from iphone to WatchKit. I have no idea of how to do this. Any help will be appreciated. Thanks in advance Add this method in the AppDelegate: func application(application: UIApplication!, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]!, reply: (([NSObject : AnyObject]!) -> Void)!) { //define your dictionary reply(yourDict) } Add this anywhere in the Apple Watch Extension: var dict = ["test" : 4] //your dictionary/request to sent to the iPhone if !WKInterfaceController.openParentApplication(dict, reply: { (reply,error) -

identifierForVendor or similar for watchOS (2.0+)

笑着哭i 提交于 2019-11-28 10:43:18
问题 Is there any replacement for identifierForVendor on watchOS (2.X)? I have been reading the documentation but it doesn't look like there's any similar method for identifying the device. Thanks! 回答1: You don't need to identify the watch. (hand wave) A user can un-pair and re-pair different watches — say, to switch between a Sport for the gym and an Edition for cocktails — and from the user's point of view when interacting with software, they appear to be the same watch. (The un/re-pairing

Apple Watchkit simulator issue: SPErrorInvalidBundleNoGizmoBinaryMessage

﹥>﹥吖頭↗ 提交于 2019-11-28 10:42:08
When I open my existing Watchkit app (Xcode 6.2), it compiles correctly, the simulators are launched (iPhone+Watch), followed by the meaningful error: Error Launching 'xxx Watchkit Extension' SPErrorInValidBundleNoGizmoBinaryMessage I have this issue with all simulators (iPhone 5/5S/6/6+ - 38mm/42mm) Any ideas what the issue can be? It seems for some reason the application does not want to run on the simulator, even though it used to. The iPhone application included in the same project does run, as do other Watchkit sample applications. Did you change the bundle ID of your app? If so you may

Page Based “reloadRootControllersWithNames:” on launch loop?

北慕城南 提交于 2019-11-28 10:06:09
- (void)awakeWithContext:(id)context { [super awakeWithContext:context]; [WKInterfaceController reloadRootControllersWithNames:@[@"pageOne", @"pageTwo"] contexts:nil]; } Following Apple's guidelines Call this method to reload the pages in your app’s page-based interface. At launch time, you use this method to customize the set of pages you want displayed. at launch time, only results in a loop. With each reload calling awakeWithContext or will Activate or init again and again. Is there a better way to go about reloading the Page-Based app on launch with a loop occurring? This is a common

FBSOpenApplicationErrorDomain Code=3

时光怂恿深爱的人放手 提交于 2019-11-28 09:35:13
I just added a Watch app to my project and try : override func awakeWithContext(context: AnyObject?) { super.awakeWithContext(context) let res = WKInterfaceController.openParentApplication(["key" : "value"]) { (replyInfo, error) -> Void in print("replyInfo : \(replyInfo) + error \(error)") } print(res) // true here } In my AppDelegate I wrote : func application(application: UIApplication, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]?, reply: ([NSObject : AnyObject]?) -> Void) { reply(["replyKey" : "replyValue"]); } When I launch the Watch app I just have : replyInfo : [:] +

How to calculate current location in WatchKit extension

一个人想着一个人 提交于 2019-11-28 08:44:07
How to calculate the current user location in Watch Kit extension as we can't use CoreLocation in watch kit. Thanks in advance Stephen Johnson You can use CoreLocation in your watch app extension very similarly to how you use it in your iPhone app. The key difference is that a user can't authorize your extension to have access to Core Location. They will need to do that from your iPhone app. So you will need to check if the user has authorized location services for your app and if they haven't, you will need to instruct them how to do it. Here is the code I use in my watch kit extension for

WatchKit: Speech to text conversion in WatchKit Apps

自闭症网瘾萝莉.ら 提交于 2019-11-28 08:13:05
问题 Can any one help me with a sample code for adding Speech to Text conversion feature in Apple Watchkit apps. 回答1: Yes, it's possible. Here is the documentation: https://developer.apple.com/library/prerelease/ios/documentation/WatchKit/Reference/WKInterfaceController_class/index.html#//apple_ref/occ/instm/WKInterfaceController/presentTextInputControllerWithSuggestions:allowedInputMode:completion: The code look like this. You provide a suggestions array with words (or emoji too) and you set the

Is there a way to access the haptic feedback via WatchKit?

白昼怎懂夜的黑 提交于 2019-11-28 07:33:29
问题 I plan to create an Apple Watch app. Is there a way to access the haptic feedback via WatchKit? 回答1: No there isn't. The following is from this post https://devforums.apple.com/thread/254540?tstart=15. There is no access to these hardware features at this time, though there is presentation of a text input controller via WKInterfaceController, which will involve the microphone. Past that, I have no information concerning forthcoming releases. 回答2: Yes. As of watchOS 2.0, you can give haptic

How to run a WatchKit App

懵懂的女人 提交于 2019-11-28 07:27:21
问题 I can't run a watchkit app from a new project. If I run Apple's sample project it runs fine. If I add watchkit to my existing project by adding a target for watchkit. Then run it I get a black screen with the time even though in my storyboard I have an interface controller that is set to main that has a blue background. This line of code gets called. - (void)willActivate { // This method is called when watch view controller is about to be visible to user [self.listTable setNumberOfRows:5