Facebook Leaderboard and Login Problem iOS Cocos2d

0 votes

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 


    [[App42Helper sharedApp42Helper] initializeApp42];

 

in my 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

 

Lastly i just created a cocos2d button / menu that when is pushed this happens

 

    [[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 

 


-(void)fbDidNotLogin:(BOOL)cancelled;
-(void)userDidLoggedOut;
-(void)userDidLoggedIn;

are never called! 

 

Also i get these logs when  i push the button:

 

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

asked Apr 19, 2016 in App42PaaS & BPaaS by differentsparksgames (10 points)

1 Answer

0 votes

Hi Gabriel,

In the sample, the parameters which is null is fetched from the NSUserDefaults and printed. If this informations are not available in the same it will print null.

The above methods are called using the delegate instance in PWFacebookHelper class, so make sure this instance is not nil.

Please look into the same sample from this link which I have updated and running fine at my end.

Let me know if you have any queries.

Thanks.

answered Apr 19, 2016 by rajeev.etc (1,660 points)
Thanks, for the support.
But i'm going to leave App42 platform. is unbelievable that you guys offer a ready to use social platform 3 years old.
Gabriel
Hi Gabriel,

The sample was created and tested with older Facebook app and the supported Facebook SDK for those apps. That's the reason you faced this issue. we were in the process of updating our samples. We take your request on higher priority and update this sample in a couple of days.


Regards,
Rajeev
Wow, that would be awesome and unexpected.
Hope to hear good news from you guys soon.
Thanks again,
Gabriel.
Hello, sorry to bother you but i'd like to now the status of the updated sample.
I stopped working on my own integration because of what you said.
Let me know if the updating process is still planned.
Thanks again,
Gabriel
Hi Gabriel,

Please download the updated sample project from here(https://www.dropbox.com/s/f921qepdf7r37n6/LeaderBoardSample.zip?dl=0) and let me know if you still have any concerns. I will be happy to help you!!

Regards,
Himanshu Sharma
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...