Permalink
Browse files

Fix the issue if autobind has not occurred and the app calls +shared

  • Loading branch information...
1 parent ff60851 commit 2ff4f936e2831f560d87390a0f1240d813c93761 @hiddenmemory committed Jun 4, 2012
Showing with 4 additions and 3 deletions.
  1. +1 −1 README.md
  2. +0 −2 sample/Hackbook/Hackbook/HackbookAppDelegate.m
  3. +3 −0 src/Facebook.m
View
@@ -57,7 +57,7 @@ If you want to issue a pull request to fix/clean/add that would be great.
- Setup your application in facebook as per normal with single sign on
- Make sure you have setup your URL handler with the scheme `fb`APPID as this is used not only on sign on but also to automatically bind the Facebook singleton object to your APPID
- If you do not wish to implement the URL handlers in the app delegate, then include `FBConnect.h` in your app delegate's header file and change the parent class from `UIResponder` to `FBAppDelegate`
- - Now you just need to access facebook how you want to using the `[Facebook shared]` accessor. Please note, at the moment there is an issue with autobind that if you try using `[Facebook shared]` before `applicationDidFinishLaunching:` has finished running it will be null, you can always call `[Facebook bind]` in that case (say in the `viewDidLoad` method in the root view controller)
+ - Now you just need to access facebook how you want to using the `[Facebook shared]` accessor.
If you want examples on how to use the new API, take a look at the `Facebook+Graph.m` code. There you will find how:
@@ -42,8 +42,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
alpha:1.0]];
[navController.navigationBar setBarStyle:UIBarStyleBlackTranslucent];
self.navigationController = navController;
-
- [Facebook bind];
// Initialize API data (for views, etc.)
apiData = [[DataSet alloc] init];
View
@@ -113,6 +113,9 @@ + (void)autobind:(NSNotification*)notification {
}
}
+ (Facebook*)shared {
+ if( !facebookSharedObject ) {
+ return [self bind];
+ }
return facebookSharedObject;
}
+ (void)load {

0 comments on commit 2ff4f93

Please sign in to comment.