Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Facebook help (CARLOSSSSSSSSSSS!!!!)
Started by peachpellen Jan 07 2011 03:44 PM

- - - - -
63 replies to this topic
[TOPIC CONTROLS]
Page 1 of 3 1 2 3
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

peachpellen

[GLOBAL: userInfoPane.html]
peachpellen
  • Contributor

  • 365 posts
  • Guests

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 :)

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

Peach
uid: 10144 topic_id: 4908 reply_id: 304908


[TOPIC: post.html]
#2

peachpellen

[GLOBAL: userInfoPane.html]
peachpellen
  • Contributor

  • 365 posts
  • Guests

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 :(
uid: 10144 topic_id: 4908 reply_id: 15902


[TOPIC: post.html]
#3

peachpellen

[GLOBAL: userInfoPane.html]
peachpellen
  • Contributor

  • 365 posts
  • Guests

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
uid: 10144 topic_id: 4908 reply_id: 15904


[TOPIC: post.html]
#4

jonbeebe

[GLOBAL: userInfoPane.html]
jonbeebe
  • Contributor

  • 511 posts
  • Corona SDK

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:


  • http://link-to-your-app-website-or-itunes-page

  • http://link-to-your-app-website-or-itunes-page

  • FACEBOOK APP ID



...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...
uid: 7849 topic_id: 4908 reply_id: 15905


[TOPIC: post.html]
#5

peachpellen

[GLOBAL: userInfoPane.html]
peachpellen
  • Contributor

  • 365 posts
  • Guests

Thanks, Jon :)

I will have a go with this now! Hopefully permissions then work properly >.<' Silly things!
uid: 10144 topic_id: 4908 reply_id: 15906


[TOPIC: post.html]
#6

peachpellen

[GLOBAL: userInfoPane.html]
peachpellen
  • Contributor

  • 365 posts
  • Guests

YES! Fantastic. It works perfectly now :D

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

Thank you!
uid: 10144 topic_id: 4908 reply_id: 15907


[TOPIC: post.html]
#7

Dotnaught

[GLOBAL: userInfoPane.html]
Dotnaught
  • Contributor

  • 370 posts
  • Corona SDK

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.
uid: 1560 topic_id: 4908 reply_id: 15931


[TOPIC: post.html]
#8

peachpellen

[GLOBAL: userInfoPane.html]
peachpellen
  • Contributor

  • 365 posts
  • Guests

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


[TOPIC: post.html]
#9

MBD

[GLOBAL: userInfoPane.html]
MBD
  • Contributor

  • 388 posts
  • Corona SDK

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?
uid: 9046 topic_id: 4908 reply_id: 16133


[TOPIC: post.html]
#10

MBD

[GLOBAL: userInfoPane.html]
MBD
  • Contributor

  • 388 posts
  • Corona SDK

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.
uid: 9046 topic_id: 4908 reply_id: 16164


[TOPIC: post.html]
#11

jonbeebe

[GLOBAL: userInfoPane.html]
jonbeebe
  • Contributor

  • 511 posts
  • Corona SDK

@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.
uid: 7849 topic_id: 4908 reply_id: 16165


[TOPIC: post.html]
#12

MBD

[GLOBAL: userInfoPane.html]
MBD
  • Contributor

  • 388 posts
  • Corona SDK

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..
uid: 9046 topic_id: 4908 reply_id: 16166


[TOPIC: post.html]
#13

jonbeebe

[GLOBAL: userInfoPane.html]
jonbeebe
  • Contributor

  • 511 posts
  • Corona SDK

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.
uid: 7849 topic_id: 4908 reply_id: 16167


[TOPIC: post.html]
#14

Tim

[GLOBAL: userInfoPane.html]
Tim
  • Contributor

  • 222 posts
  • Alumni

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
uid: 8196 topic_id: 4908 reply_id: 16987


[TOPIC: post.html]
#15

ash

[GLOBAL: userInfoPane.html]
ash
  • Observer

  • 27 posts
  • Guests

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.
uid: 11554 topic_id: 4908 reply_id: 17289


[TOPIC: post.html]
#16

carlos m. icaza

[GLOBAL: userInfoPane.html]
carlos m. icaza
  • Corona Geek

  • 2,992 posts
  • Alumni

Who is this CARLOOOOOOOOOOSSSSSSSSSSSSSSS you speak of?

C.
uid: 24 topic_id: 4908 reply_id: 17291


[TOPIC: post.html]
#17

rsuperman2

[GLOBAL: userInfoPane.html]
rsuperman2
  • Observer

  • 2 posts
  • Guests

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
uid: 23678 topic_id: 4908 reply_id: 17884


[TOPIC: post.html]
#18

peachpellen

[GLOBAL: userInfoPane.html]
peachpellen
  • Contributor

  • 365 posts
  • Guests

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

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 :)
uid: 10144 topic_id: 4908 reply_id: 17902


[TOPIC: post.html]
#19

peachpellen

[GLOBAL: userInfoPane.html]
peachpellen
  • Contributor

  • 365 posts
  • Guests

Who is this CARLOOOOOOOOOOSSSSSSSSSSSSSSS you speak of?

C.


I'm sorry, I always assumed that was your full name :P

Peachhhhhhhhhhhhhhhhhhhhhhhhhhhh. xx
uid: 10144 topic_id: 4908 reply_id: 17903


[TOPIC: post.html]
#20

rsuperman2

[GLOBAL: userInfoPane.html]
rsuperman2
  • Observer

  • 2 posts
  • Guests

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
uid: 23678 topic_id: 4908 reply_id: 17953


[TOPIC: post.html]
#21

peachpellen

[GLOBAL: userInfoPane.html]
peachpellen
  • Contributor

  • 365 posts
  • Guests

I personally never liked the Facebook demo with it's "Not Connected" thingy-majiggy - I'm sure many did but I never quite "got it", if you get me :P

Are you simply trying to integrate Facebook posting? (Like posting a status or a score to a wall?)

If so, shoot me an email - my name here at gmail dot com - I can absolutely help you out with that :) (To clarify, I mean for free - I know some people charge money for their services but I'm totally happy to just help you out.)

Get in touch if you need it; now or later :)

Peach :)

PS - if I am slow to respond it just means I'm sleeping, haha, odd hours ;)
uid: 10144 topic_id: 4908 reply_id: 17974


[TOPIC: post.html]
#22

MBD

[GLOBAL: userInfoPane.html]
MBD
  • Contributor

  • 388 posts
  • Corona SDK

Has anyone posted an example of posting to a friends wall?
uid: 9046 topic_id: 4908 reply_id: 18313


[TOPIC: post.html]
#23

gazjm

[GLOBAL: userInfoPane.html]
gazjm
  • Contributor

  • 159 posts
  • Corona SDK

EDIT: Ignore post - I just wasn't giving facebook enough time to cache the image.

I have used the code and can successfully send a post to my wall, but it isn't showing the image which I put a link to. Think it would usually show up as a big-ish image on the left of the facebook post.

Does anybody have any idea why?

here is the code

[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 = math.floor(settings.score)
gameScore = tostring( gameScore )

local theMessage = "I just scored " .. gameScore .. " on Bounty Hunter!"

facebook.request( "me/feed", "POST", {
message=theMessage,
name="Think your a better hunter than me? Click here to download Bounty Hunter!",
caption="Download Bounty Hunter and see if you can beat " .. gameScore .. "! I dare you to try!",
link="http://itunes.apple.com/us/app/bounty-hunter/id400301575?mt=8",
picture="http://i38.photobucket.com/albums/e148/Gaz_20VT/gameinaday/iconWeb.png" } )

end
end
end

facebook.login( "1xxxxxxxxxxx4242", facebookListener, { "publish_stream" } )
end
[/blockcode]

Thanks for any help.
uid: 8699 topic_id: 4908 reply_id: 23328


[TOPIC: post.html]
#24

eng.tareqali

[GLOBAL: userInfoPane.html]
eng.tareqali
  • Enthusiast

  • 87 posts
  • Corona SDK

hey guys, I made the same, I can connect with my facebook page,

but when I posted the score, I cant see it in my Face book Page,

what is the problem ?
uid: 13061 topic_id: 4908 reply_id: 29568


[TOPIC: post.html]
#25

peachpellen

[GLOBAL: userInfoPane.html]
peachpellen
  • Contributor

  • 365 posts
  • Guests

When you say you posted it but can't see it, do you mean you can't see the score in the post or you can't see the post at all?
uid: 10144 topic_id: 4908 reply_id: 29573



[topic_controls]
Page 1 of 3 1 2 3
 
[/topic_controls]