简体   繁体   中英

Facebook SDK iOS - Authorise In-App?

I have found that in the Facebook.m class I can do this:

[self authorizeWithFBAppAuth:NO safariAuth:NO];

I changed each of these from YES to NO as I don't want to user to leave my application to authorise my application.

However now having done that I get no in-app prompt of any kind to authorise, so how can I authorise myself now inside my application without the user going to either Safari or the Facebook app to authorise?

Thanks.

i see what your problem is.

in my opinion get the latest https://github.com/facebook/facebook-ios-sdk and then override

[device respondsToSelector:@selector(isMultitaskingSupported)] && [device isMultitaskingSupported]

in facebook.m to always return false line 160

Because Facebook (and Twitter) use oAuth, you need to use a webpage to run the authorization. However, using a webpage to do authorization is not the same as leaving your app to do authorization.

I believe the way that Facebook authorization in many apps is done with a UIWebView in the app. You can have a look at ShareKit and how they've implemented several "in app" authorizations for various services.

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