Nathan Cleary
Nathan Cleary

Reputation: 653

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!

Upvotes: 0

Views: 895

Answers (2)

bernese
bernese

Reputation: 176

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.

Upvotes: 3

Javier Beltrán
Javier Beltrán

Reputation: 756

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

Upvotes: 1

Related Questions