我为Apple手表创建了一个较小的项目,以便与其工作的父应用程序进行通信。
所以我在现有的iOS项目中创建了一个Watch kit扩展,但是从Watch端调用openparent应用程序时它会收到
“错误:错误域= FBSOpenApplicationErrorDomain代码= 5"无法完成操作。 (FBSOpenApplicationErrorDomain错误5。)“。
这个错误意味着什么?有任何目标问题吗?请找到以下代码:
观看工具包方:
- (IBAction)satusButtonClicked {
NSLog(@"StausButtonClicked");
NSDictionary *senddict=[[NSDictionary alloc] initWithObjects:@[@"5",@"Two",@"Three"] forKeys:@[@"1",@"2",@"3"]];
[InterfaceController openParentApplication:senddict reply:^(NSDictionary *replyInfo, NSError *error) {
NSLog(@"ReplyReceived : %lu",(unsigned long)[replyInfo count]);
NSLog(@"Reply Info: %@", replyInfo);
NSLog(@"Error: %@", error);
}];
}
iOS方面:
-(void)application:(UIApplication *)application handleWatchKitExtensionRequest:(NSDictionary *)userInfo reply:(void (^)(NSDictionary *))reply
{
NSLog(@"Watckit call received");
reply(@{@"Score": @"234"});
答案 0 :(得分:6)
In the info.plist, I had "Application Does Not Run in Background" set to YES. This caused the problem. Changing that setting to NO fixed it.
从这里回答: iOS Error: FBSOpenApplicationErrorDomain error 5. What does this mean?