Skip to content

Commit

Permalink
Merge branch 'master' of github.com:facebook/facebook-ios-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Yujuan Bao committed Aug 16, 2010
2 parents a15b811 + eb15631 commit 4cd09ef
Showing 1 changed file with 16 additions and 24 deletions.
40 changes: 16 additions & 24 deletions README.mdown
@@ -1,15 +1,9 @@
Facebook iOS SDK
Facebook Connect for iOS
===========================

This open source iOS library allows you to integrate Facebook into your iOS application include iPhone, iPad and iPod touch.

Except as otherwise noted, the Facebook iOS SDK is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html)

Known Issues
------------
* If you see an "Missing client_id" error, that means you did not set your application id. For our demo app to run, you need to set your app id in the file DemoAppViewController.m of DemoApp or mainViewController in theRunAround, set the kAppId to be your own app id in string format.

* If you see "an invalid next or cancel parameter was specified" message in the login dialog, then you need to migrate your application to the New Data Permissions. This can be done by going to http://www.facebook.com/developers/apps.php then selecting the application you are testing with, and clicking "Edit Settings" (the third item underneath Total Users). On the settings page, click on Migrations (bottom of the left menu), then set New Data Permissions to "Enabled"
Except as otherwise noted, the Facebook Connect iOS SDK is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html)

Getting Started
===============
Expand All @@ -19,25 +13,21 @@ The SDK is lightweight and has no external dependencies. Getting started is quic
Install necessary packages
--------------------------

* Follow the [iPhone Dev Center Getting Started Documents](https://developer.apple.com/iphone/index.action).
* Set up for iPhone development by following [iPhone Dev Center Getting Started Documents](https://developer.apple.com/iphone/index.action).

* Install [Git](http://git-scm.com/).

* Pull the read-only repository from github.
* Pull code down from github:

git clone git://github.com/facebook/facebook-iphone-sdk-2.0.git

if you have trouble, you could also try

git clone http://github.com/facebook/facebook-iphone-sdk-2.0.git"
git clone git://github.com/facebook/facebook-ios-sdk.git

Create your own application
---------------------------

* Create a Facebook Application at: http://www.facebook.com/developers/createapp.php

* Check out the mobile documentation at: http://developers.facebook.com/docs/guides/mobile/

* Adding FBConnect to your Xcode project
* Open the src/FBConnect.xcodeproj project file.
* Adding Connect to your Xcode project
* Open src/facebook-ios-sdk.xcodeproj
* Drag the "FBConnect" group into your application's Xcode project.
* Make sure that the FBConnect headers are in the include path. Go into your project's settings and enter the relative or absolute path to the "src" directory.
* Include the FBConnect headers in your code:
Expand Down Expand Up @@ -70,8 +60,6 @@ User login and application permission requests use the same method: authorize().

If you pass in extra permissions in the permissions parameter (e.g. "publish_stream", "offline_access"), then the user will be prompted to grant these permissions. "offline_access" is particularly useful, as it avoids access expiration and ongoing prompts to the user for access. See http://developers.facebook.com/docs/authentication/permissions

This SDK uses the (http://tools.ietf.org/html/draft-ietf-oauth-v2)["user-agent"] flow from OAuth 2.0 for authentication details.

To authorize a user, the simplest usage is:

facebook = [[Facebook alloc] init];
Expand Down Expand Up @@ -102,10 +90,10 @@ The FBRequestDelegate is an interface that handle the request response that your
Note that the server response is in JSON string format. The SDK use a open source package json frame work (http://code.google.com/p/json-framework/) to parse the result. If there is error, it will call request:didFailWithError: function in the FBRequestDelegate. If it is succeed, it will call request:didLoad: function in the FBRequestDelegate. The result passed to the FBRequestDelegate can be an NSArray for multiple results or a NSDictionary for single result.
i whose fields and values can be inspected and accessed. The sample implementation checks for a variety of error conditions and raises JSON or Facebook exceptions if the content is invalid or includes an error generated by the server. Advanced applications may wish to provide their own parsing and error handling.

The (http://developers.facebook.com/docs/reference/rest/)[Old REST API] is also supported. To access the older methods, pass in the named parameters and method name as a NSDictionary.
The [Old REST API](http://developers.facebook.com/docs/reference/rest/) is also supported. To access the older methods, pass in the named parameters and method name as a NSDictionary.

NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"4", @"uids", @"name", @"fields", nil];
[facebook requestWithMethodName: @"users.getInfo" andParams: params andHttpMethod: @"GET" andDelegate: self];
[facebook requestWithMethodName: @"users.getInfo" andParams: params andHttpMethod: @"GET" andDelegate: self];


User Interface Dialogs
Expand All @@ -114,7 +102,7 @@ User Interface Dialogs
This SDK provides a method for popping up a Facebook dialog. The currently supported dialogs are the login and permissions dialogs used in the authorization flow, and a "stream.publish" flow for making a wall post. The dialog require an action to perform, and a FBDialogDelegate interface for notification that must be implemented by the application. For example,

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: apiKey, @"api_key", nil];

[facebook dialog: @"stream.publish" andParams: params andDelegate:self];

This allows you to provide basic Facebook functionality in your application with a singe line of code -- no need to build native dialogs, make API calls, or handle responses.
Expand All @@ -124,3 +112,7 @@ Error Handling

For Request and Dialog, errors are handled by FBRequestDelegate and FBDialogDelegate callback methods. Application can implement these interface to handle them.

Troubleshooting
------------
: I get a ''missing client_id'' error.
; Read the setup instructions and make sure your application ID is set.

0 comments on commit 4cd09ef

Please sign in to comment.