How to determine if someone has deleted an application from facebook and is reviewing the application?

This is one of the test cases that needs to be checked.

  1. Someone removes your application from Facebook through the application settings and revises your application. Your application should detect this and call the person to enter the system. Go to your application and click “Sign in to Facebook”, click “OK” to accept read permissions (and click “OK” again to accept write permissions, if applicable). Go to the application settings on Facebook and delete the application. Repeat steps 1-2 and make sure it works on Facebook.

I have not found a way to achieve this. When I uninstall the application on facebook, my iOS still thinks the session is valid. There is a discussion here at Stackoverflow. But the solution provided does not seem to work.

This is what I still logged into. But I can’t detect when the user uninstalled the application on facebook. Any tips please?

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
   if (FBSession.activeSession.state == FBSessionStateCreatedTokenLoaded) {
      NSLog(@"Found a cached session");
      // If there one, just open the session silently, without showing the user the login UI
      [FBSession openActiveSessionWithReadPermissions:@[@"public_profile"]
                                         allowLoginUI:NO
                                    completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
                                      // Handler for session state changes
                                      // This method will be called EACH time the session state changes,
                                      // also for intermediate states and NOT just when the session open
                                      [self sessionStateChanged:session state:state error:error];
                                    }];

      // If there no cached session, we will show a login button
    } else {
      UIButton *loginButton = [self.customLoginViewController loginButton];
      [loginButton setTitle:@"Log in with Facebook" forState:UIControlStateNormal];
    }
  }  

- (void)sessionStateChanged:(FBSession *)session state:(FBSessionState) state error:(NSError *)error
  {
          // If the session was opened successfully
          if (!error && state == FBSessionStateOpen){
            NSLog(@"Session opened");
            // Show the user the logged-in UI
            [self userLoggedIn];
            return;
          }
          if (state == FBSessionStateClosed || state == FBSessionStateClosedLoginFailed){
            // If the session is closed
            NSLog(@"Session closed");
            // Show the user the logged-out UI
            [self userLoggedOut];
          }
   }
+4
source share
2 answers

Facebook , Facebook "deauthorize callback url", . , canvas, , , , .

0

All Articles