Facebook Integration in IOS - iphone

i am using FBConnect in my project for integration of Facebook.but now i saw in all apps,when the user tap the Facebook button,it goes directly to the FaceBook App in the device to open for login.i think this is done with URLschema to communicate the App to App in a device.but how can we o this in case of Facebook.
My need is ,i have a sharing option in my app to Facebook,so when the user tap the button it needs to open the Facebook app in the device for login,and after successful login it needs to come back to my app also.how to o this?.is there any sample project or apps to do this.
Thanks in advance.

Look for the FBSessionDelegate. You provide the delegate which gets callbacks when the FB login completes (successfully or not). Also the FBConnect code, see git://github.com/facebook/facebook-ios-sdk.git, has a sample directory with a Hackbook Xcode project. That should get you started!
Here is the Facebook iOS Tutorial (which uses FBConnect).

You can use the Graph API(Uses OAuth 201 authentication protocol) instead of FBConnect , which is newer and a lot easier.You can implement it inthe following steps:-
1>Get unique id and api key from facebook's develooper portal.
2>Display the login page of the facebook in your app.
3>Allow the user to loginthrough following URL
https://graph.facebook.com/oauth/authorize?
client_id=[API key]&
redirect_uri=http://www.facebook.com/connect/login_success.html&
scope=[extended permissions]&
type=user_agent&
display=touch
you can implement the FBLoginView in UIWebView and present it.The code is be large so i am giving a link to Ray Wendelich's Facebook Graph API

Related

Misconfigured: App Sorry, That Helps hasn't been approved for display in App Center

I have a simple Facebook App that I use to allow users of my website to login with Facebook. Recently I added a basic custom story via the open graph API, e.g.
Nick plays a mixtape via anexample.com
The custom story appears in my stream as expected, however when I click the anexample.com link on the story I get the following error and cannot access the actual Facebook App page:
Sorry, the details for anexample.com cannot be displayed because the app is
misconfigured.
What is strange, is that the application redirects at
https://www.facebook.com/games/?app_id=AN_APPLICATION_ID
despite the fact that the app is not registered as a game.
Has anyone else faced this behaviour?
Thanks,
On tapping on the App link, you could navigate it in one of the two possible ways
Any FB page: Add the page in Advanced settings of your App.
A website: Add a web platform

iOS 5 Facebook Integration

I am writing an app and for the first time I want to integrate some Facebook SDK functionality. I want to have the user login to their Facebook account, then be able to choose one of their friends to "compete" against in the app.
I am following the instructions on the Facebook developers site for iOS but what I can't seem to figure out is how to present a "login with Facebook" view when the app is launched and then never again while the Facebook SSO is authorized or unless the user logs out of the app.
The example I'll use for this is like the DrawSomething app's workflow for authentication.
Any ideas of how to accomplish this? Tutorials or examples would be awesome! I am using iOS 5 with storyboards for the app if that makes a difference.
Thanks!
-Brian
First authenticate :
Facebook API/SDK integration

Open IOS Application which uses sharekit via fbconnect and/or sharekit from facebook app or facebook website

Does anyone of you know if it is possible to open a App which uses sharekit from a Facebook request by clicking on the request either in the facebook app, or in the browser?
I could not find anything about this in the web.
To be more precise i want my app which uses sharekit to send a request to a facebook-friend. This facebook friend should then be able to open the same app by clicking on the request either in the facebook app on his mobile device or by clicking on the request on the facebook browser page which is opened on his mobile device.
I already know how to share things in facebook via sharekit, but to get it "the other way round" seems to be difficult. I could not find anything helpful in the web so far.
Greets and many thanks in advance,
Maverick1st
Yes. Your will will need to register itself as a protocol handler, and the link clicked on from Facebook app would need to use the url scheme you define.
Example:
my-social-app://invite/1234
Keep in mind if the recipient does not have the app installed, or they do this on their desktop machine, they will get a message that the phone is unable to open that URL.
See this tutorial: http://mobileorchard.com/apple-approved-iphone-inter-process-communication/

Connect to Facebook using Facebook app on iPhone

How to connect to Facebook using the downloaded Facebook app, and not the embeeded Facebook connect. This is done for example with Rockmelt app.
What seems to be done, is to launche a third party app using the url like (fb:some paramaeters) and having a callback url with your app (myapp://authentification parameter ).
The interest of this is that if you are already logged on facebook, you just need to approve or not your app.
What is missing, is what are the parameters to acheive this with the downloaded facebook app.
Just use the supplied Facebook Connect library as it handles all this for you. FBConnect by default will use single sign on either via the browser or the facebook app if already installed.
You can examine the source code of the FBConnect library to see how this is done if you wish, but I'd suggest that re-inventing the wheel is perhaps not the best way to go.

Facebook Connect Open native facebook App,

I have an iPhone app using facebook connection using FBConnect from github code.
It worked fine in the simulator, however when I installed it in the device with existing facebook app from facebook it didn't work. It opens the existing facebook app instead of returning to my own app.
Checkout this link.
Better you can go with the approach given in the link as it works fine. I have myself tried this code and it has worked for me.
Also the sample project (with Facebook API implemented in it) is given in the below link which will be helpful for you to while implementing the facebook API as per the method given in the below link.
http://www.raywenderlich.com/1488/how-to-use-facebooks-new-graph-api-from-your-iphone-app
Also you can test the sample project on your device before going for this approach
Hope this helps you.
EDIT:
Have you registered a URL handler to respond to return requests from the Facebook app? on iOS 4 the Facebook SDK uses fast app switching which is designed to let the app handle most of the heavy lifting and let the users just hit "Accept" instead of having to re-enter login/passwords