简体   繁体   中英

Facebook iOS SDK - how to determine if user has deleted app without calling authorize each time?

I'm implementing the Facebook iOS SDK in my app as directed in the Facebook docs. Namely, access tokens and respective expiries are saved such that anytime my Facebook login routine is executed, it can check isSessionValid and if YES it avoids performing an extraneous authorize call. This works great, except when the user has since deauthorized/deleted the Facebook app.

Because isSessionValid only checks if there's a saved access token and expiry is okay, it doesn't seem like there's any way to catch the case where the app was deauthorized and thus execute authorize again.

Does anyone have a good solution for this?

Because my app maintains its own session and should keep users logged in indefinitely, the whole routine should only really happen once so the overhead of just forgetting about saving tokens/expiries and running authorize each time might not be so bad. Let me know what you think.

You can set only authorization with Safari or inside App authorization, to do this you have to edit Facebook.m file from:

[self authorizeWithFBAppAuth:YES safariAuth:YES];

to:

[self authorizeWithFBAppAuth:NO safariAuth:NO];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM