Facebook integration - has anything changed?

Hi, I was wondering if someone could helpe with this. I am trying to post the high score from my app onto Facebook using the code from Peach Pellen’s tutorial. I have successfully used this in another app and it prompts a log in then posts the score. However, when I tried to use the same code in my new app, instead of a log in box it looks like it tries to open Facebook in the web browser the just closes.

I have checked on Facebook mobile and both apps appear to be set up the same. I am using the correct app ID for the new app and have even tried using the other code examples from the tutorials here but that gives the same result. I feel like the solution is an obvious one but I just can’t see it.

Any ideas while I still have a few strands of hair left would be welcome.

Thanks! [import]uid: 85388 topic_id: 29684 reply_id: 329684[/import]

Are you building with the same iOS Bundle ID that’s in your Facebook app? [import]uid: 40033 topic_id: 29684 reply_id: 119183[/import]

Hi, thanks for the reply.In the code I am using the Facebook app ID that I got when I registered my apps Apple ID with Facebook. [import]uid: 85388 topic_id: 29684 reply_id: 119199[/import]

Ok, I went back over what I did yesterday and still can’t see where I am going wrong. I tried using the sample code given in the Corona Facebook example app using the ID from my new app and the same thing happens: Facebook is called, but instead of asking for a log in it looks like a browser window which then moves and is replaced with a second window that looks like it is trying to connect to Facebook, then after about 2 seconds this disappears and it I am returned to my app.

Has anyone else experienced this? I am confused why my first app managed to get Facebook working fine (and still does) back in June but it does not seem to work this time. I have a feeling it is something to do with the way the app is registered with Facebook but I can’t see where I am messing up.

Thanks in advance! [import]uid: 85388 topic_id: 29684 reply_id: 119213[/import]

@petersandford1982, have you looked at this? It might help: http://www.coronalabs.com/blog/2012/01/04/implementing-facebook-single-sign-on/

Naomi [import]uid: 67217 topic_id: 29684 reply_id: 119265[/import]

Hi Naomi, and thanks for the link. I had already had a look at that example, and Peach’s tutorial, and other examples on the forums but all had the same result - Facebook would be called and then somehow cancelled when connecting. I have now used another example from Peach’s tutorials and I think it is getting closer, although now rather than asking me to log in before posting the message it takes me directly to my Facebook page, as if it is accessing it through my Facebook app?

Like I said above, I am sure it was to do with something I did when registering or building the app with the SDK so I may just have to start over. I checked my earlier app and it still posts fine to Facebook, although trying to use the same code (and replacing the AppID) just produces the same result as above. [import]uid: 85388 topic_id: 29684 reply_id: 119271[/import]

@petersandford1982, another thing you might want to look at is the Facebook sample code that comes bundled with Corona SDK. It should have the code that’s compatible with the version of Corona build you are using: CoronaSDK > SampleCode > Networking > Facebook

I just worked out the Facebook login for my second game I’m working on, and referring to the sample code did the trick for me (using daily build 876.)

Naomi

[import]uid: 67217 topic_id: 29684 reply_id: 119275[/import]

Thanks Naomi, I had looked at that too and then just as I was about to through my computer out of my window I realized that it was to do with the distribution profile I was using, coupled with a coding error. What a fool! Anyway, it looks like it is now fixed, so will keep my fingers crossed that it stays that way.

Thank you so much for your help! [import]uid: 85388 topic_id: 29684 reply_id: 119278[/import]

@petersandford1982, I’m so glad to hear you got this sorted. Don’t we all go through these moments?

Cheers,
Naomi [import]uid: 67217 topic_id: 29684 reply_id: 119281[/import]

@naomi, yeah, I guess so. I am about to tackle Game Center integration so I think those moments are going to keep on coming! LoL

Thanks again, will pay closer attention to the tutorials this time. [import]uid: 85388 topic_id: 29684 reply_id: 119282[/import]