简体   繁体   中英

UIWebView to View Controller?

I was wondering if anyone knew if this was possible?

I have a uiwebview as the first view controller which is showing a basic html page I made with the Facebook login screen. Can you login (in the uiwebview) and once it authorises you (in the uiwebview) it closes and launches the second view controller?

Does anyone know of a good example or tutorial for this?

If not can someone point me in the direction of a good FacebookSDK example or tutorial in Storyboard not XIB?

Thanks!

You should be using the FBLoginView and FBSession classes of the Facebook SDK to log in. You can just use the delegate callbacks from those to drive your next view controller.

I can't think of a reason you would want to bring up the facebook login page in a UIWebView , rather than doing the above. If for some reason you actually need to use a UIWebView , the webViewDidFinishLoad: method of UIWebViewDelegate might provide you with the hook you need.

Download the Facebook sdk from github and check the SessionLoginSample in samples. I think it has everything you need

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