I've seen reports for errors 4 but not for 5. I get this as a console message when I'm trying to use an "openParentApplication:reply" request. There isn't enough information in the log to know if the problem is in the iOS code, the WK code or the Simulator. I've restarted the sim, and cleaned the project. Any ideas?
WK Code:
- (IBAction)sendRequest {
NSDictionary *request = @{@"request":@"Request1"};
[InterfaceController openParentApplication:request reply:^(NSDictionary *replyInfo, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
[self.label1 setText:[replyInfo objectForKey:@"response1"]];
[self.label2 setText:[replyInfo objectForKey:@"response2"]];
[self.label3 setText:[replyInfo objectForKey:@"response3"]];
}
}];
}
iOS Code:
- (void)application:(UIApplication *)application handleWatchKitExtensionRequest:(NSDictionary *)userInfo reply:(void (^)(NSDictionary *))reply{
NSLog(@"%s", __FUNCTION__);
//([max intValue] - [min intValue]) + [min intValue]
int randNum1 = arc4random_uniform(16);
int randNum2 = arc4random_uniform(16);
int randNum3 = arc4random_uniform(16);
NSString *num1 = [NSString stringWithFormat:@"Test%d", randNum1];
NSString *num2 = [NSString stringWithFormat:@"Test%d", randNum2];
NSString *num3 = [NSString stringWithFormat:@"Test%d", randNum3];
if ([[userInfo objectForKey:@"request"] isEqualToString:@"Request1"]) {
NSLog(@"containing app received message from watch: Request1");
NSDictionary *response = @{@"response1" : num1, @"response2" : num2, @"response3" : num3};
reply(response);
}
}
The only console log is:
WatchKit Extension[48954:9523373] Error Domain=FBSOpenApplicationErrorDomain Code=5 "The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 5.)