Hello there.
I followed this tutorial
http://api.shephertz.com/tutorial/iOS-leaderboard/?index=leaderboard-sample
I first had some troubles with the button, there's no such button named Login_facebook.png
in the FacebookSDKResources.bundle , so used this one FacebookSDKResources.bundle/FBLoginView/images/login-button-small.png
anyway i registered as a FB developer and added my FacebookAppID to my info.plist file, then copied the App42Helper and Leaderboard folders to my project. Setted the app and secret key , and the game level in LDConstants and added
1 | [[App42Helper sharedApp42Helper] initializeApp42];
|
in my
1 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
Lastly i just created a cocos2d button / menu that when is pushed this happens
1 2 3 4 | [[PWFacebookHelper sharedInstance] setDelegate:self];
[[PWFacebookHelper sharedInstance] openSessionWithAllowLoginUI:YES];
NSString *anID = [[PWFacebookHelper sharedInstance] userId];
NSLog(@ "facebook id %@" ,anID);
|
When i push the button in game, i get redirect to facebook and asked for a login, then for permissions.
I do all that, but the NSLog always displays facebook it NULL and also the protocol functions
1 2 3 | -( void )fbDidNotLogin:(BOOL)cancelled;
-( void )userDidLoggedOut;
-( void )userDidLoggedIn;
|
are never called!
Also i get these logs when i push the button:
1 2 3 4 5 6 | 16 - 04 - 19 09 : 56 : 26.736 Save The Penguin[ 8019 : 1312941 ] openSessionWithAllowLoginUI response
2016 - 04 - 19 09 : 56 : 26.736 Save The Penguin[ 8019 : 1312941 ] userInfoDict=( null )
2016 - 04 - 19 09 : 56 : 26.736 Save The Penguin[ 8019 : 1312941 ] self.userName=( null )
2016 - 04 - 19 09 : 56 : 26.747 Save The Penguin[ 8019 : 1312941 ] error=( null )
2016 - 04 - 19 09 : 56 : 29.410 Save The Penguin[ 8019 : 1312941 ] facebook id ( null )
2016 - 04 - 19 09 : 56 : 30.478 Save The Penguin[ 8019 : 1312941 ] LaunchServices: ERROR: There is no registered handler for URL scheme fbauth
|
What am i missing?
Thanks a lot,
Gabriel
Ps. all the testing are made on the simulator, ios 9.2