Facebook help (CARLOSSSSSSSSSSS!!!!)

Hey all, mostly Carlos or anyone else who’s more likely to be “in the know” about this than the rest of us;

I do (mostly) understand the new FB code now and I can make it do what I want; or I could, but I’m running into an issue and I think it’s at the FB end of things.

Previously when creating an application all the advanced settings were set to “Disabled” and this worked fine, however now when I create a new app, by default, most are enabled with a few disabled.

Can anyone tell me what I need set here to make this work?

My last app posts fine, but it was prior to these changes when creating a new app on the FB end; I’ll continue to fiddle about with it while I wait, but I’d really love a prompt response; cheers :slight_smile:

PS - It doesn’t HAVE to be Carlos. Any uber person will do :3

Peach [import]uid: 10144 topic_id: 4908 reply_id: 304908[/import]

I know it’s only been 24 hours but I’m a bit desperate here.

Has anyone got a working FB post in the past few days from a newly created app? If so, can you let me know your FB advanced settings please, as far as what is enabled and what isn’t?

Peach :frowning: [import]uid: 10144 topic_id: 4908 reply_id: 15902[/import]

Alright - here’s something;

My older apps were requesting permission to post to a person’s wall. (This is checked in FB app settings; all the older ones have this permission.)

The newer ones, however, only have access to my information.

:S [import]uid: 10144 topic_id: 4908 reply_id: 15904[/import]

I got Facebook posting to work with two apps recently, with the latest builds. Here’s the settings I change whenever I create a new app (everything else I leave how it is):

ABOUT

Fill in all the details for your app.

WEB SITE

I fill out my website url, I don’t think this really matters.

FACEBOOK INTEGRATION

Leave as-is.

MOBILE AND DEVICES

I select HTML5 / mobile web and also enter my app store ID for the app. It’ll work if you don’t enter the app, but I notice if you do, it adds some extra app info to your wall post.

ADVANCED

Leave as-is.


And here’s the code that I use to get facebook posting to work. NOTE: It can be attached to a ui button, or anything really, BUT NOT a native.showAlert. For some reason, the Facebook dialog won’t work if you use it in conjunction with a native.showAlert() call. I submitted a bug about it already.

So as long as you’re not using a native.showAlert() call (to say, ask them if they want to post to their facebook wall), then the below code should work just fine:

[blockcode]

local callFacebook = function()
local facebookListener = function( event )
if ( “session” == event.type ) then
– upon successful login, update their status
if ( “login” == event.phase ) then

local gameScore = 123456
gameScore = tostring( gameScore )

local theMessage = “just scored a " … gameScore … " playing an awesome game.”

facebook.request( “me/feed”, “POST”, {
message=theMessage,
name=“Download This Awesome Game to Compete with Me!”,
caption="Think you can beat my score of " … gameScore … “? I dare you to try!”,
link=“http://link-to-your-app-website-or-itunes-page”,
picture=“http://link-to-90x90-image” } )

end
end
end

facebook.login( “FACEBOOK APP ID”, facebookListener, { “publish_stream” } )
end

callFacebook()

[/blockcode]

In the above code, replace:

…With their relevant counterparts.

Then just use ‘callFacebook()’ whenever you need a status message posted to their wall. Attach it to a ui button, a touch event, or wherever you want (except a native.showAlert!).

Hope that helps… [import]uid: 7849 topic_id: 4908 reply_id: 15905[/import]

Thanks, Jon :slight_smile:

I will have a go with this now! Hopefully permissions then work properly >.

YES! Fantastic. It works perfectly now :smiley:

Getting permission to wall post again; which the old code had stopped doing.

Thank you! [import]uid: 10144 topic_id: 4908 reply_id: 15907[/import]

Speaking of Facebook code, has anyone tried doing anything other than posting info to the user’s wall? I was trying to figure out how to get the user’s name, for example, to make app use more personal, but I don’t have any experience using the Facebook API. [import]uid: 1560 topic_id: 4908 reply_id: 15931[/import]

I wouldn’t mind knowing how to post a picture from the app, if that’s possible. :3 [import]uid: 10144 topic_id: 4908 reply_id: 15970[/import]

My facebook app posts are working fine on the iphone side, but the android side gives me a force close after facebook login - so the post never goes.
Anyone else experiencing this as well? [import]uid: 9046 topic_id: 4908 reply_id: 16133[/import]

Does anyone have an good working code to logout of facebook from within the app? I’ve tried a few examples that were in the API documentation with no avail.
[import]uid: 9046 topic_id: 4908 reply_id: 16164[/import]

@MBD: Did you try facebook.logout()? I haven’t tried that in any of my apps yet, but if you haven’t seen that, that’s probably what you’re looking for. [import]uid: 7849 topic_id: 4908 reply_id: 16165[/import]

Yes, I made a simple lister on a ui button that fires off facebook.logout() when pressed but it just closes my entire app on iOS for some reason. I’ve also tried the other examnple in the API (with my app id) and no luck…
[import]uid: 9046 topic_id: 4908 reply_id: 16166[/import]

Ohhh… that definitely doesn’t sound right. You should forward that to bugs@anscamobile.com so they can get it fixed as soon as possible. [import]uid: 7849 topic_id: 4908 reply_id: 16167[/import]

Hi,

We’ve posted an updated version of the Facebook SDK sample that demonstrates how to post a message, post a photo from a URL, get the user name, and logout.

http://developer.anscamobile.com/sample-code/networking

Note this version specifies the {"publish\_stream"} permissions in the third parameter to the facebook.login() call. This is required to allow your app to publish posts/photos on the user’s behalf (eg, without using facebook.showDialog().) Some people (including yours truly) had been testing with an older Facebook app ID which didn’t require this parameter (got the “grandfather” permissions clause or something) which caused some confusion.

Tim [import]uid: 8196 topic_id: 4908 reply_id: 16987[/import]

Tim, any chance we can get a sample of how to post an image as a byte-array instead of from an image url. We do this from Flash all the time, just a post to the user’s image gallery.

Here is an example in Flash:

[as3]
var userImageData : BitmapData = new BitmapData (clip.width, clip.height, false, 0x0);
userImageData.draw (clip, null);

var userImageByteArray : ByteArray = new ByteArray ();
userImageByteArray = PNGEncoder.encode (userImageData);

var params : Object = {
image : userImageData,
message : imageMessage,
fileName : imageName
};

Facebook.api (‘me/photos’, callback, params, ‘POST’);
[/as3]

The post is sent as multi-part form data. [import]uid: 11554 topic_id: 4908 reply_id: 17289[/import]

Who is this CARLOOOOOOOOOOSSSSSSSSSSSSSSS you speak of?

C. [import]uid: 24 topic_id: 4908 reply_id: 17291[/import]

Hi,

I downloaded the new sample (I myself are fairly new having started last night) but seems I can’t get it to run on the simulator. Still haven’t tried on the actual iPhone.

The code compiles fine but in the simulator there’s a message at the bottom “Not Connected”. Also, looking in the terminal, I see an error that says first argument to facebook.login() should be a string. I get this error for all other buttons except logout which instead gives a warning that this function is not supported by the simulator.

Also, I noticed that the facebook.lua is not in the project folder. I tried adding this but that didn’t resolve any of the issues. It is being included by main so not sure how this is not giving me an error since it’s not in the folder.

Thanks in advance for your help!

Rami [import]uid: 23678 topic_id: 4908 reply_id: 17884[/import]

rsuperman2 - I can explain both of those things for you :slight_smile:

  1. Facebook and OpenFeint will not run in the simulator; they need to be on the actual iPhone.

  2. Facebook.lua should NEVER be in the folder now; it is added when you compile/build - this is also the case when you require “physics” or “OpenFeint”.

Make sense?

Peach :slight_smile: [import]uid: 10144 topic_id: 4908 reply_id: 17902[/import]

Who is this CARLOOOOOOOOOOSSSSSSSSSSSSSSS you speak of?

C.

I’m sorry, I always assumed that was your full name :stuck_out_tongue:

Peachhhhhhhhhhhhhhhhhhhhhhhhhhhh. xx [import]uid: 10144 topic_id: 4908 reply_id: 17903[/import]

Awesome Peach! Thanks so much for your quick response!

So I managed to get the sample facebook app onto my phone this morning (lots of firsts this week =) but still having the same issue as it says “not connected” at the bottom of the screen and none of the buttons have any functionality.

Thoughts are very much appreciated =)

R [import]uid: 23678 topic_id: 4908 reply_id: 17953[/import]