Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Facebook documentation incorrect. - Page 4 — Gideros Forum

Facebook documentation incorrect.

124»

Comments

  • jdbcjdbc Member
    edited May 2014
    But with app requests procedure is as follows

    You need to read all app requests for user upon login
    You need to delete each app request after processing it, so it won't be processed again.

    So existing user sends an app request to none approved user. It works as invite. You can provide the message as Invite you blabla. And set data field to some value as invite, so you would know this request is to invite.

    Once the none approved user joins your app, you read its app requests, and you see that existing user sent him a request with data as invite. Then you go credit this user for inviting and delete this app request.
    If multiple users have invited this new user, you either credit all of them or compare created_time field to know who was the first.

    Same thing with sending lives and hearts or bonuses to each other.

    User sends other user a heart or a bonus, you store all the data you need in data field (up to 255 characters) and the when other user logs in, check the requests and display the message, accept, delete, ignore.
    On accept credit the bonus to user and offer to send one back and delete request
    On delete simply delete request
    On ignore, do nothing and same request will be displayed next time you load the user or on push of specific button, etc
    I see.

    I was using Parse REST API for storing some extra data, so for instance an invitation request for logged user as a Invitation class in the following way:
    Invitation (from, to, status)
    where status can be "accepted", "denied", "ignored"... and from, to will be Facebook userid (unique for my app)
  • ar2rsawseenar2rsawseen Maintainer
    edited May 2014
    @SinisterSoft from facebook docs (https://developers.facebook.com/docs/apps/changelog#v2_0_graph_api):

    App-scoped User IDs: To better protect people's information, when people log into a version of your app that has been upgraded to use Graph API v2.0, Facebook will now issue an app-scoped ID rather than that person's orginal ID. However, for users that have previously logged into your app, the user ID will not change.
  • SinisterSoftSinisterSoft Maintainer
    edited May 2014
    Hmm... How do you grab the person's photo then - if you don't know the original ID ?

    "https://graph.facebook.com/"..id.."/picture?type=square"
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • ar2rsawseenar2rsawseen Maintainer
    Nothing stated in their docs about this case, most probably the scoped ids will work here too
  • SinisterSoftSinisterSoft Maintainer
    I made up a new fb account and it appeared to grab the correct image.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • @ar2rsawseen hello. Can you put somewhere separate sample working on taking pictures with the Facebook? I get login, but on "facebook:getProfile()" application crash.
  • ar2rsawseenar2rsawseen Maintainer
    You simply access this urls with UrlLoader and storing the data:
    https://graph.facebook.com/{id}/picture?type=small
    https://graph.facebook.com/{id}/picture?type=square
    https://graph.facebook.com/{id}/picture?type=normal
    https://graph.facebook.com/{id}/picture?type=large

    Basically here is the example on how I do it:
    http://giderosmobile.com/forum/discussion/comment/33814#Comment_33814

    Will try to add it somewhere in the examples ;)
  • @ar2rsawseen yes, thx. Its eclips apparently. Make a new application, it works, insert in my, nope). Well, there'll handle myself, thank you.
  • Hello,
    I have an issue using the facebook labs plugin 0.6 on iOS.
    When I launch it and try to login, the phone switch to facebook application asking my facebook account to grant access to my application. When I accept it, the phone switch back to my application but then it crashes without any error message.
    I tried with both GiderosPlayer and App exported but both make it crash. I was not able to find out what happened, even prints in the Login_complete callback are never reached.

    On android, ot appears that there is an issue with the Facebook app. A similar behavior is observed when facebook app is installed.

    Has someone experienced such issues?
    Otherwise, can you provide a code sample to log in and retrieve basic infos?
    Am I missing something?

    Thanks in advance.
  • ar2rsawseenar2rsawseen Maintainer
    @lsouchet so both android and ios versions does not work for you?
    There should be at least some errors or pointers in logcat in eclipse or log output in xCode, aren't there any?

  • Android is working properly if no Facebook app is installed, it does all access granting process through we browser.

    I haven't got any logs last time I tried. As for iOS, I used to have an error about NSNetwork not reachable but I did not manage to reproduce it yesterday.
    I will keep on trying to get usefull logs to help, but I would like to have a code sample to be sure I am doing it the right way.

    Thanks.
  • ar2rsawseenar2rsawseen Maintainer
    Here is what I use for test:
    require "facebook"
     
    facebook:addEventListener(Event.LOGIN_COMPLETE, function()
    	print("login successful")
    end)
    facebook:addEventListener(Event.DIALOG_ERROR, function(e)
    	print("dialog error", e.type, e.error)
    end)
    facebook:addEventListener(Event.DIALOG_COMPLETE, function(e)
    	print("dialog complete", e.type, e.response)
    end)
    facebook:addEventListener(Event.LOGOUT_COMPLETE, function()
    	print("logged out")
    end)
    facebook:addEventListener(Event.REQUEST_COMPLETE, function(e)
    	print("request complete:", e.type, e.response)
    end)
     
    facebook:addEventListener(Event.REQUEST_ERROR, function(e)
    	print("request error:", e.type, e.error)
    end)
     
    facebook:addEventListener(Event.OPEN_URL, function(e)
    	print("deep link:", e.url)
    end)
     
    facebook:login("appId", {"public_profile", "user_friends", "publish_actions"})
     
    local text = TextField.new(nil, "post to wall")
    text:setScale(3)
    text:setPosition(10, 50)
    stage:addChild(text)
    text:addEventListener(Event.TOUCHES_BEGIN, function(e)
    	if text:hitTestPoint(e.touch.x, e.touch.y) then
    		print("try")
    		facebook:dialog("feed", {
    			link = "<a href="http://giderosmobile.com"" rel="nofollow">http://giderosmobile.com"</a>, 
    			picture = "<a href="http://www.giderosmobile.com/wp-content/uploads/2012/06/gideros-mobile-small.png"" rel="nofollow">http://www.giderosmobile.com/wp-content/uploads/2012/06/gideros-mobile-small.png"</a>, 
    			name = "GiderosMobile.com", 
    			caption = "Awesome tool", 
    			description = "Check out this awesome product"
    		})
    	end
    end)
     
     
    local text2 = TextField.new(nil, "Make api request")
    text2:setScale(3)
    text2:setPosition(10, 150)
    stage:addChild(text2)
    text2:addEventListener(Event.TOUCHES_BEGIN, function(e)
    	if text2:hitTestPoint(e.touch.x, e.touch.y) then
    		print("try")
    		facebook:getProfile()
    	end
    end)
  • Hi @ar2rsawseen,
    So I tested with your example and on my iPad I have the following behavior when I run it in the player:
    - Switch app to FB app asking me once for account authorization
    - After I accepted, switch back to another app (Gideros player?), black screen, then home screen of gideros player with device IP address.

    In xCode console, I don't have any faulty log, only (approximately, I don't have the exact logs right now):

    Gideros starting render thread
    Gideros end render thread

    And appearently the debug session of the app stops after the black screen.
    It appears that during the black screen, the app crashes and automatically reboot but detach debugging session from XCode.

    As for the app configuration, I did stuff on FB website to get an app token and I downloaded the plugin from the labs and installed it as I did for all plugins.

    Is there a special step that I am missing?

    I am a bit lost here...

    thank you for your help!
  • @lsouchet :
    Do not use player, it often fail.

    Install the app as non player,
    and don't forget to remove "fbxxxxx" from GiderosPlayer and add it to your app.

    Hope this help.

    ----

    I did have an error like this, but that because i override application openURL at AppDelegate, might be not your problem.

  • @lsouchet :
    Do not use player, it often fail.

    Install the app as non player,
    and don't forget to remove "fbxxxxx" from GiderosPlayer and add it to your app.
    what do you mean by "remove "fbxxxxx" from GiderosPlayer and add it to your app."?



  • @lsouchet :
    that URL scheme, which you probably added to your Gideros Player.
    Do not forget to remove it, and add it to your installed app.
  • Thanks to both of you, I found my way out.
    Exported the app allowed me to do the whole facebook config of my project again. There was some errors in my .plist.

    It works for me in both app and player.
    I'll let you know if I encounter other problems.
    Thanks again!
  • jdbcjdbc Member
    edited July 2014
    What about anonymous Facebook login? Does Gideros Facebook plugin support it?

    https://developers.facebook.com/products/anonymous-login/

    Has anybody implemented in some Gideros game?
  • SinisterSoftSinisterSoft Maintainer
    Applied for it, not heard anything back.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • jdbcjdbc Member
    The Facebook plugin for Gideros is from 2014 and it is deprecated.

    Any plans to update to lastest Facebook SDK versión?
    https://developers.facebook.com/docs/android/getting-started
Sign In or Register to comment.