Open Feint help for beginner

Leaderboards are broken in 2010.109. They were working in the previous release, but OpenFeint changed their syntax with the newer version (which Corona upgraded to) and some small things got broken in the process, Achievements one of them.

In the next release it’ll be fixed though. What I did, since I didn’t find that out until AFTER I tried to code in all my achievements, is just comment out the Achievements code, and set all your OF achievements to “secret” in the OF backend, that way when it is fixed in the next release, it’s just a matter of “un-secreting” and “un-commenting” everything.

I had to ship my update to Dungeon Tap (1.1.0) without Achievements this time around but will have 20 in the next version. [import]uid: 7849 topic_id: 3035 reply_id: 9509[/import]

I wanted to ask you, do you know how to make Facebook work, or is it well and truly broken currently? I downloaded Doodle Dash the other day and saw it was working in that, so if you had any advice to offer it’d be great. ^-^; [import]uid: 10144 topic_id: 3035 reply_id: 9512[/import]

Facebook is broken too: the demo app no longer works. I am hoping they’ll fix it soon as I have an app that’s about ready to be submitted and I don’t want to disable FB connectivity.
[import]uid: 1560 topic_id: 3035 reply_id: 9514[/import]

Facebook works, it’s currently in Dungeon Tap and the just-approved update to Dragon’s Keep and both were built with 2010.109.

For general Facebook-status posting, it’s copy/paste code from the included Facebook sample app (might be in the original SDK, not Game Edition–just download the trial dmg if you don’t have the original).

Some advice:

It can be a little confusing when it comes to setting up the application WITHIN Facebook and getting all the settings just right. I wrestled with this one quite a bit.

In my Facebook Friends Leaderboard tutorial, it outlines step by step instructions on getting your Facebook app setup within the Facebook developers backend (Step 2), and shows you what settings you need to use. Some of it is irrelevant to JUST Facebook status posting though, because the tutorial was meant to set up an entire Facebook Friends Leaderboard (like you see in Doodle Jump & Bejeweled Blitz), so I think you can ignore the ‘domain’ steps but everything else still applies (oh, and in the tutorial you DON’T need your API key for facebook leaderboard, but you WILL need it for Facebook status posting per the included Corona sample app).

Here’s a link to the tutorial:

http://ideveloper.kodingen.com/2010/facebook-friends-leaderboard/

Other than the stuff you have to do on the Facebook site itself, once again, the rest is just copy/paste (and replacing with your own api key and stuff) from the Facebook sample app. [import]uid: 7849 topic_id: 3035 reply_id: 9515[/import]

@Dotnaught: Facebook posting is working fine in all of my games, I even have a Facebook Friends Leaderboard in two of them.

In the sample app, are you replacing the api key and everything with your own Facebook application info? The sample app won’t work by itself, because you have to register as a Facebook developer, set up an “application” and then get your credentials from their backend.

Here’s a huge tip that, while in the process of figuring it out, through me through a bunch of hoops:

Once you’re logged into the Facebook developer’s backend, in the Mobile and Devices sub-panel, make sure Application Type is set to HTML 5 / mobile web. It’s a little ironic, but trust me status messages just WOULNDN’T POST when I had it set otherwise and it took me forever to pinpoint the problem. Should save you a huge headache.


Also note that the above “hardships” with Facebook currently lie within the way Facebook applications/status posting etc. work and is not something Corona or Ansca has control of, I wish Facebook would make it a little more streamlined. [import]uid: 7849 topic_id: 3035 reply_id: 9516[/import]

This is all REALLY hopeful; I’m going to get back into it now and, hopefully, get Facebook working.

I’ll be back ^-^; [import]uid: 10144 topic_id: 3035 reply_id: 9518[/import]

Alright, I did all that - including fixing the fact it was NOT set to HTML5 (I hadn’t seen this mentioned before now, I’m sure it was, but I mustn’t have taken it in or the like) and sadly STILL no joy. Exact same result. (I’ve turned my phone off and on, uninstalled and reinstalled, etc.)

I get a login screen, I put in my user name and password, I get a grey screen, then white, then it goes back to my app, then grey, then white, then back to the app.

I’m really frustrated with it as I’ve copied the code across multiple times from that sample and I have re-entered my secret and key multiple times.

Is there anything else I could be missing? [import]uid: 10144 topic_id: 3035 reply_id: 9521[/import]

Annnnnnnnnd it is working >.
It seems like maybe it just took more than the “few minutes” for the changes to save at FB’s end, it appears. [import]uid: 10144 topic_id: 3035 reply_id: 9522[/import]

Good to hear peach as I’m getting ready to start adding in fb [import]uid: 7911 topic_id: 3035 reply_id: 9523[/import]

I also finished my splash screen and optimized the code for it last night
To night I’m adding fb to the splash and some pretty’s [import]uid: 7911 topic_id: 3035 reply_id: 9525[/import]

I did replace all the info and it was working in my test app…until I tested it again recently. Then I rebuild the facebook demo app and it didn’t work for me either. However, looking at the control panel as you suggested I see an application ID (oath) that is not used. The Ansca code calls for the Facebook API key and the secret, but not the app ID. Is this new?

I should also ask does it makes a difference if the secret and API key is in single or double quotes? (Ansca code uses single, tried both out of frustration and neither are working for me atm). [import]uid: 1560 topic_id: 3035 reply_id: 9524[/import]

jonbeebe - can you help me out with one more thing please?

I notice that with Doodle Dash!, and some other apps about the place, when one posts to Facebook there is also a message, like the normal “status” type post, above the Doodle Dash! stuff and that’s where the score is mentioned.

Like;

Peach Pellen is playing X and just scored Y!

|-----| Random text linking to stuff
|_____|
comment - like - Z

That top line is what I’ve been trying to do, but I can’t work out how - I tried using “status” and “message” under “name” and above “media” but wasn’t able to get it going.

Can you help? I’m sure it’s simple when you know how but I can’t find the right documentation for help :frowning:

Peach/ [import]uid: 10144 topic_id: 3035 reply_id: 9563[/import]

I actually had to do quite a bit of digging in the Facebook documentation to figure that one out.

In your connectHandler() function, towards the top look for this line:

local attachment = {…

Here’s my code for Dungeon tap to give you an idea:

[blockcode]
local attachment = {
name=“Download Dungeon Tap To Compete With Me”,
caption="Think you can beat my score of " … tostring(gameScore) … “? I dare you to try!”,
href=“http://itunes.apple.com/us/app/dungeon-tap/id393526203?mt=8”,
media= { { type=“image”, src=“http://beebegamesonline.appspot.com/dungeontapnews/facebook90.png”, href=“http://itunes.apple.com/us/app/dungeon-tap/id393526203?mt=8” } }
}
[/blockcode]

You’d obviously replace the iTunes link and the icon image with your own, but from that code you can definitely get an idea how to structure your “attachment” json string.

name is the bold status title that appears at the top, and caption is the gray text to the right of the media icon.

Oh, and to get your iTunes link before your app is in the app store, just replace “dungeon-tap” with your app’s name (spaces replaced with dashes “-”), then create your app in iTunes connect and it’ll create an App ID for you. From there, replace everything between id and ?mt=8 with your App ID). [import]uid: 7849 topic_id: 3035 reply_id: 9566[/import]

Ahhhhhh, caption! Thank you. I shall have a go at this before getting into the Halloween activities planned for this evening.

Such a fast reply :smiley: Most appreciated! [import]uid: 10144 topic_id: 3035 reply_id: 9567[/import]

Hmmmm, I had a brief poke and couldn’t get it working - I tried replacing the caption line with this in case it was something to do with the score I’d gotten confused over, but this doesn’t work either.

caption="This is a test!",

Beyond adding in that line, is there anything else I need to do? Any changes in other files or anything?

/rubs head

It’s all quite confusing the first time around! [import]uid: 10144 topic_id: 3035 reply_id: 9569[/import]

Captions really the only thing you need for that, did you check your syntax? Make sure there’s a comma after the name line and all other lines, etc.?

That’s the only thing I can think of really… Most of my problems with FB, after figuring out how to actually do it, has always been with simple syntax errors… Try copy/pasting my code exactly, and just replacing the values with your own and see if that works. [import]uid: 7849 topic_id: 3035 reply_id: 9570[/import]

Compiling to test right now. :slight_smile: [import]uid: 10144 topic_id: 3035 reply_id: 9571[/import]

Erm, OK, maybe crossed wires ^-^;

What I wanted was to post as the text one would enter immediately after there name, as though they typed in their status box :slight_smile:

This code for a caption is for some small grey text below the “name” on one’s page, in your example, below “Download Dungeon Tap To Compete With Me”

Does that make sense? I’m trying to get it as the actual status. [import]uid: 10144 topic_id: 3035 reply_id: 9572[/import]

Haha oops, my bad, forgot to include something (sorry about that).

ABOVE the attachment = {… line, add this:

[blockcode]
local scoreStatusMessage = “this is the status message”
[/blockcode]

Then, down below the “attachment = {…” line, look for something like this:

[blockcode]
local response = session:call{
message = scoreStatusMessage,
method =“stream.publish”,
attachment = json.encode(attachment),
action_links = json.encode(action_links),
}
[/blockcode]

The “message = scoreStatusMessage” line is the one that handles the actual status posting message (where it looks like they wrote it), and the “attachment = json.encode(attachment)” line is the one that handles the rest of the stuff you already took care of.

Sorry about leaving that stuff out, the FB api is pretty confusing to me too, just been looking at my own source code because it took forever to figure out lol. [import]uid: 7849 topic_id: 3035 reply_id: 9574[/import]

It was my fault - I’m horrible at explaining things; particularly when I don’t really “get” them ^-^;

Thanks again, I doubt I’ll have time to get to all this tonight (I’m pretty slow still) as I only have 35 or so to eat and get ready, but Happy Halloween to you, and I’ll post here later to hopefully say I’ve got it all working now :wink:

Peach. [import]uid: 10144 topic_id: 3035 reply_id: 9576[/import]