Facebook integration in xcode 4.5 with ios6? - iphone

I need to integrate Facebook login page in my app.i.e I m providing user various login options like he can login with my website account or facebook account and continue the activities with in our app thats it.I dont want him to perform any other activities with facebook.He can just login.
So I have through some of the tutorials which say to drag and drop FBConnect and write some code.But when I drag and drop FBConnect Im getting errors when I complile project saying FBConnect/FBSession.h not found etc .
And sometimes Facebook tutorials say to use Appkey and AppSecret when using FBConnect.But sometimes they dont use, when importing FacebookSDK.framework
I couldnot understand how could I proceed further.
Should I use FBConnect ?Is AppKey neccessary?I just want to give option to user that he can login through Facebook also in my app
Please guide me in this aspect..

Yes even for giving user a option to login with facebook , you need to integrate the facebook sdk and the app id is required.
Since you are using xcode 4.5 then you have to use facebook sdk 3.1 not 3.0.(it will give errors).
See the developers.facebook.com, they have provided all the details you want.
http://developers.facebook.com/docs/reference/ios/3.1/
http://developers.facebook.com/ios/
First you need to set up environment for your app:-
http://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/3.1/
Then implement the login feature:-
http://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/authenticate/
I hope this might helps you.

Related

iOS app misconfigured for Facebook integration

I am using the facebook-iphone-sdk framework to integrate my iPhone app to FB. The problem is when I click the button it gives an error "The application you are using is misconfigured for the Facebook integration. Please download the latest version of the app."
I was able to connect with FB only once. For the first time it worked fine and I was also able to post some data into my wall but afterwords it not working, and the above error occurs.
What could I be doing wrong?
The Bundle ID is case sensitive so watch out for that.
e.g. com.myapp.MyApp is not the same as com.myapp.myapp
This happened to me and gave the same error message.
May be you are using the deprecated API of facebook... Please use the New FBGraph API for facebook integration ....
How to share or post by mail, twitter and facebook from the current application?
This is not only about email... here you will find the tutorial and sample code for facebook integration.....!!
Possible Solutions:
1) Double Check that you are putting in the right facebook app id in your code, and that you didnt somehow overwrite that when you made it work the first time.
2) Check that in the facebook developer profile you have all the proper things set up (They have decent doc's for how to set up properly).
3) Check that you are using the most up to date version of the SDK for fb.
4) Consider using the built-in Facebook for iOS6, since you probably wont be releasing your app before iOS 6 comes out anyways.
5) If all else fails, start over and go through the instructions from beginning to end. Check and re-check everything you set up and carefully scan for little typos or something. It's probably a minor mistake somewhere that you're overlooking.
6) Post code if you want more specific help. An error message isnt enough to deduce what your problem is.
Just delete you app from facebook dashboard, create it again, and then change the facebookID in you App-Info.plist, in the key FacebookAppId and URL types array key. I did it and my app works fine.
Delete facebook app, force perform login in safari..

Facebook Integration in IOS

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

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

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.

Getting Facebook Permissions from FBJS like normal apps

I am developing an FB app which is going to use the Javascript SDK only, not the PHP library or any server side code. When I try to ask permissions from users for the first login to my application the permissions dialogue JS SDK shows is the pop-up one, used for FB Connect, but I want it to redirect the first time user to the normal application permissions page, and I want to do it using the JS SDK. Can someone please help me with this.
FYI : This is an application on apps.facebook.com
Not entirely sure you can do this, but you could try to use the OAuth dialog (see http://developers.facebook.com/docs/reference/dialogs/oauth/) and use the display option set to page.
Let me know if that works.