I would like to test the code path where a Facebook user's access token has expired and I need to renew the token. I noticed that the access token expires 2 months after it has been created. I don't want to wait 2 months to test that code path, so I would like a way to simulate this expiration. I am scared that my code will crash if I never test this situation for the following mysteries:
- Currently upon app launch, I call
[FBSession openActiveSessionWithReadPermissions:permArray allowLoginUI:NO completionHandler:someFunction]
to silently reconnect a Facebook user that has already connected in the past. Notice how allowLoginUI is NO. Does it have to be YES to allow the user to re-login and renew the token or can the token be silently renewed? - The completion handler of any openActiveSession* call is triggered every time the session state changes. Two notable states are
FBSessionStateOpen
andFBSessionStateOpenTokenExtended
. When the token becomes extended, does the state machine remain in the token extended state, or will it go to the extended state and then immediately go to the open state? I need to know the state transition, so I don't run my handlers twice. - Does
[FBSession activeSession].accessToken
become nil or does it remain as the old expired token? - Similarly for
[FBSession activeSession].expirationDate
: is it nil, the old expiration date, or automatically becomes new expiration date?