IOS Facebook SDK resets application after revoking application rights

I have a problem with the Facebook SDK. In my application, I have the option to remove the application from the facebook user account via Facebook Graph Request:

        NSString *graphPath = [NSString stringWithFormat:@"/%@/permissions", [FBSDKAccessToken currentAccessToken].userID];
    [[[FBSDKGraphRequest alloc] initWithGraphPath:graphPath parameters:nil HTTPMethod:@"DELETE"]
     startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
         if (!error) {
             NSLog(@"Facebook removed");
         } else {
             NSLog(@"Facebook error: %@", error);
         }
     }];

Everything works fine, but if I try to log in again using logInWithReadPermissionsFBSDKLoginManager, Safari appears, I click "Contiune" to authorize the application, and it fails with an error:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[3]'

When I try to log in after starting the application again, everything works fine.

Do you have any clue what could be causing this?

UPDATE:

An exception occurs in one of the FBSDKCoreKit files, namely in FBSDKTimeSpentData.m, on lines 149-155:

NSDictionary *timeSpentData =
  @{
    FBSDKTimeSpentPersistKeySessionSecondsSpent : @(_secondsSpentInCurrentSession),
    FBSDKTimeSpentPersistKeySessionNumInterruptions : @(_numInterruptionsInCurrentSession),
    FBSDKTimeSpentPersistKeyLastSuspendTime : @(now),
    FBSDKTimeSpentPersistKeySessionID : _sessionID,
    };

_sessionID nil This variable is initialized to

- (void)instanceRestore:(BOOL)calledFromActivateApp

which can be called up in the application by calling

[FBSDKAppEvents activateApp]

instanceRestore:

if (!_isCurrentlyLoaded) {
//
}

, _sessionID .

+4
1

iOS Facebook . Pls, Facebook SDK. FBSDKLoginKit (4.13.1) .

+1

All Articles