Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating Facebook iOS SDK with Comments using Connect

On an iOS application, I plan to host Facebook Comments using Facebook Connect within an UIWebView, have already done some tests and read articles where I think that it shall work fine. My question regards authentication: I wanted to use Facebook iOS sdk to have and store the proper tokens within Objective C, so that the user doesn't have to do it every time. I know how to inject any data in the UIWebView if needed, but my question is WHAT do I need to inject so that the facebook scripts already see the user as authenticated every time ? Thanks

like image 843
user1111389 Avatar asked Dec 22 '11 09:12

user1111389


People also ask

What data does Facebook SDK collect iOS?

Facebook SDK. To provide functionality within the Facebook SDK, we may receive and process certain contact, location, identifier, and device information associated with Facebook users and their use of your application.

How do I connect my iOS account to Facebook?

Steps. Tap the Settings app on the device. Scroll and tap the "Facebook" button, which can be found just a little bit below the button labeled Twitter. Tap and enter your Facebook account credentials (username and password) into the login screen's appropriate boxes.

What is Facebook SDK for iOS?

The Facebook SDK enables: Facebook Login - Authenticate people with their Facebook credentials. Share and Send dialogs - Enable sharing content from your app to Facebook. App Events - Log events in your application.


2 Answers

See https://developers.facebook.com/docs/authentication/. You will get an access token when you authenticate the user which you can then use throughout your application to request information on the users behalf.

like image 192
Bot Avatar answered Oct 23 '22 17:10

Bot


Download the latest Facebook iOS SDK.

Create the Facebook object:

Facebook *myFacebook;
[self myMethodToDoSomeAuthenticatedStuffsWithAccessToken:myFacebook.accessToken];

Also, you can see the sample "Hackbook" project to see how the access token is setup for the Facebook object within the application and how it is auto refreshed.

This keeps the user authenticated on the iOS Device and you can use this access token a NSString* type to do your stuffs.

like image 27
Ralph Avatar answered Oct 23 '22 19:10

Ralph