It’s important to test and verify that your Facebook Login flow works well under a variety of conditions. To test your Login flow, first create a separate Facebook user account:
Before you test each use case below, make sure you remove your app from your test user's Facebook account using app settings.
Log in with Facebook
buttonIn this case, your token will be invalid and you should notify users that their Facebook session has expired and ask them to log in again.
In this case, you should make sure your app detects the error so that it can notify users and redirect them to the non-iOS integrated version of Facebook Login.
Please read our guide on handling token expiration
If someone clicks “Cancel” in response to your Facebook Login read permissions request, he / she will need to go into the iOS system settings to re-enable Login for your app.
In cases where people have previously denied Facebook permissions via iOS integrated login, your app should use conventional fast app switch login for future permissions requests. In terms of SDK calls, don't use FBSessionLoginBehaviorUseSystemAccountIfPresent as the FBSessionLoginBehavior in this case. See FBSession for versions 3.24 and older of the SDK and FBSDKAccessToken currentAccessToken and FBSDKLoginManager for newer versions.
In your app settings (under "Roles", i.e., https://developers.facebook.com/apps/{YOUR_APP_ID}/roles/test-users/
), you can create test user accounts to verify your Facebook integration without worrying about spamming.
In the iOS SDK, the class FBSDKTestUsersManager
(in FBSDKCoreKit
) can be used to easily fetch access tokens for those test users so that you can write automated integration tests. Note this class requires your app secret and you should ensure the app secret is not included in your released app.