IOS error: FBSOpenApplicationErrorDomain 5 error. What does this mean?

I saw error reports 4 , but not for 5. I get this as a console message when I try to use "openParentApplication: response". There is not enough information in the journal to find out if there is a problem in the iOS code, WK-code or simulator. I restarted the simulator and cleared 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:

 WatchKit Extension[48954:9523373] Error Domain=FBSOpenApplicationErrorDomain Code=5 "The operation couldn't be completed. (FBSOpenApplicationErrorDomain error 5.) 
+5
source share
3 answers

I suggest you try to simplify. I answered a very similar problem here which is in Swift. I would simplify the logic as follows:

WK Code

 - (IBAction)sendRequest { [InterfaceController openParentApplication:request reply:^(NSDictionary *replyInfo, NSError *error) { NSLog(@"Reply Info: %@", replyInfo); NSLog(@"Error: %@", error); }]; } 

iOS code

 - (void)application:(UIApplication *)application handleWatchKitExtensionRequest:(NSDictionary *)userInfo reply:(void (^)(NSDictionary *))reply { NSDictionary *response = @{@"replyKey" : @"replyValue"}; reply(response); } 

Once you do this, start adding extra parsing one step at a time. You can also attach a debugger to your iOS application to complete the call by following these instructions. Perhaps you are not calling the response block in the iOS application, and you do not even know it.

+1
source

Today I faced the same problem.

  • Remote application from the simulator 😂
  • Reset Simulator 😟
  • Rebooted Xcode 😦
  • Changes made to info.plist 😥

But when I launched the application in Production , it worked 😃. The application worked well in production mode with a simulator.

enter image description here

Then I deleted the existing dev mode scheme and created another dev mode scheme, and it worked. Then he reminded me that when implementing the background fetch function in the application, I checked the Launch due to a background fetch event option in this dev scheme. Later I refused Background Fetch , but forgot to uncheck this box. 😠

enter image description here

+5
source

In my case, the simulator left the problem.

+1
source

Source: https://habr.com/ru/post/1214914/


All Articles