apple-watch

How to launch iOS App from Apple Watch?

可紊 提交于 2019-11-28 19:39:49
Is there any way to launch the iOS App from Apple Watch? Edit :- Tried using both api below but doesn't work:- Apple Watch Code Calling Inside interfaceController.m + (BOOL)openParentApplication:(NSDictionary *)userInfo reply:(void(^)(NSDictionary *replyInfo, NSError *error)) reply; // launches containing iOS application on the phone. userInfo must be non-nil iOS Code Calling Inside Appdelegate.m - (void) application:(UIApplication *) application handleWatchKitExtensionRequest:(NSDictionary *)userInfo reply:(void (^)(NSDictionary *))reply The answer is actually pretty interesting. It is YES

Launch host app from watch app

好久不见. 提交于 2019-11-28 18:55:20
I know that the openParentApplication api in watch kit extension can open the host app in the background but not in the foreground. I also tried using openUrl() api of NSExtensionContext as below: NSExtensionContext *ctx = [[NSExtensionContext alloc] init]; NSURL *url = [NSURL URLWithString:@"myScheme://today"]; [ctx openURL:url completionHandler:^(BOOL success) { NSLog(@"fun=%s after completion. success=%d", __func__, success); }]; [ctx completeRequestReturningItems:ctx.inputItems completionHandler:nil]; Here too the host app is not launched. Am I missing something? or is it not possible to

Non-Public Library SockPuppetGizmo

时光毁灭记忆、已成空白 提交于 2019-11-28 16:39:01
I got an email that my latest binary submission to Apple for an iOS/Watch OS app was invalid due to: The app links to non-public libraries in PlugIns/iPrayed.appex/iPrayed WatchKit App.app/_WatchKitStub/WK: /System/Library/PrivateFrameworks/SockPuppetGizmo.framework/SockPuppetGizmo I have submitted this build before without any issues, and only made a couple of changes to a few lines of code, without adding anything at all. Any clue what this is about? Seems to be working now. Submission just gives a warning but the binary goes up fine and can be submitted. You have not done anything wrong. I

Apple Watch notification issue: WatchKit error - unable to find interface controller class to instantiate

断了今生、忘了曾经 提交于 2019-11-28 14:42:00
I am getting the following error when I am trying to push my notification controller dynamically. 2015-03-30 13:18:53.324 MyApp WatchKit Extension[79826:1951724] Took too long to show custom notification. Falling back to static. 2015-03-30 13:26:13.831 MyApp WatchKit Extension[79826:1957863] WatchKit error - unable to find interface controller class '_TtC26MyApp_WatchKit_Extension19InterfaceController' to instantiate I heard there might be a glitch, but as far as I am concern it is only occurring on the Xcode beta and not Xcode 6.2. I change the module regarding the notification storyboard to

Open WatchKit application from iOS

冷暖自知 提交于 2019-11-28 14:22:45
I would like to open WatchKit application to the foreground (or Glance if it is possible) directly from my iPhone. I've been playing with it, but have no success. Maybe someone have found some workarounds? So answer is No, you can't open Watchkit App from iPhone . The WatchKit extension can only request the system to launch the parent iPhone app, which it will run in the background. There is currently no support for this to work the other way around. Nope, Its not possible as of now. Let's hope Apple add that support & release it in coming WWDC. The iPhone app can't launch the Apple Watch app

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

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

Playing sound in Apple Watchkit

时间秒杀一切 提交于 2019-11-28 07:22:42
问题 I'm trying to play a sound through the watchkit extension using WKAudioFilePlayer however no sound gets played. I'm using the haptic feedback code as a sort of debug to be sure it executes it (which it does). As a side note, mute is not on and the filename is correct. NSURL *falcon = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"falcon" ofType:@"mp3"]]; WKAudioFileAsset *asset = [WKAudioFileAsset assetWithURL:falcon]; WKAudioFilePlayerItem *sound = [WKAudioFilePlayerItem