I am trying to start ios parent application from watchkit application. I am using url scheme to run the application. But it looks like
-(void)application:(UIApplication *)application handleWatchKitExtensionRequest:(NSDictionary *)userInfo reply:(void (^)(NSDictionary *))reply
never called. The watch app seems to launch the app in backgound. But the parent application does not process the watchkit request. I tried my approach in a new project and it works great. Is there something I need to pay attention to?
I already tried to debug> Attach to process> myapp and place a breakpoint inside the handleWatchKitExtensionRequest method to confirm whether it is called and not being called.
Here is the progress, I call openParentApplication when the button is pressed in the watch app.
@IBAction func viewOniPhoneAction() { let userInfo: [NSObject : AnyObject] = [ "userID" : user.userID ] WKInterfaceController.openParentApplication(userInfo, reply: { (userInfo : [NSObject : AnyObject]!, error : NSError!) -> Void in }) }
Here is my delegeate app
- (void)application:(UIApplication *)application handleWatchKitExtensionRequest:(NSDictionary *)userInfo reply:(void(^)(NSDictionary *replyInfo))reply { NSDictionary *replyDict = @{@"response": @"done"}; reply(replyDict); }
I tried reply() in handleWatchKitExtensionRequest , but I got this error in the response block from the monitoring application
Error Error Domain=com.apple.watchkit.errors Code=2 "The UIApplicationDelegate in the iPhone App never called reply() in -[UIApplicationDelegate application:handleWatchKitExtensionRequest:reply:]" UserInfo=0x60800026e0c0 {NSLocalizedDescription=The UIApplicationDelegate in the iPhone App never called reply() in -[UIApplicationDelegate application:handleWatchKitExtensionRequest:reply:]}
source share