Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
share score on facebook - Page 2 - Gideros Forum

share score on facebook

2»

Comments

  • Is there a way to post more than one score?
    My game will have levels and I wanted to post scores for each level of the game ... like candy cruch.
  • fxonefxone Member
    edited June 2013
    @pedroluis5 after my weekly experience I can say, that is not possible to make leaderboards for each level of the game based on Scores API by Facebook :) But you can make some equivalent of engagement by building Achievements (https://developers.facebook.com/docs/howtos/achievements/) for every level, when it's fully completed (if maximum&limited points have been reached). I suppose, that is possible such solution, for now ;)
  • lsouchetlsouchet Member
    edited November 2014
    Hello,

    I am facing a problem similar to this one, but only with the exported project:
    my app needs post score of user and to do this the app needs this permission...
    request error	5	Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x1d5a9350 {com.facebook.sdk:HTTPStatusCode=403, com.facebook.sdk:ParsedJSONResponseKey=(
            {
            body =         {
                error =             {
                    code = 200;
                    message = "(#200) Requires extended permission: publish_actions";
                    type = OAuthException;
                };
            };
            code = 403;
        }
    ), com.facebook.sdk:ErrorSessionKey=<FBSession: 0x1d5a4b30, state: FBSessionStateOpen, loginHandler: 0x0, appID: 132957176893573, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionManualTokenCachingStrategy: 0x1d53f210>, expirationDate: 2013-07-01 21:32:01 +0000, refreshDate: 2013-05-02 23:18:43 +0000, attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(null)>}
    The postPhoto() works fine inside the player but not with the exported app.
    I always get a
    com.facebook.sdk error 5
    through the onRequestError

    I reset the facebook sdk config in xcode several times but it did not change anything.
    I also tried to remove the FacebookDisplayName pref in my *.plist.

    @ar2rsawseen, What do you think about it?

    Thanks!
  • @ar2rsawseen tks for help ^:)^ . I remove FacebookDisplayName from the .plist and now work.
    I can post and get score of my user.
    Now i will try to get score of my friends..

    tks :D
    @pedroluis5 where is the .plist file?

  • somezombiegmsomezombiegm Member
    edited May 2015
    @achimeno, @ar2rsawseen
    --Get scores
    if facebook:isSessionValid() then
    	facebook:graphRequest(conf.facebookAppId.."/scores")
    end
    The above request only returns the logged user's scores. How can I return the user's friends scores? I don't even know how to obtain their info.
  • ar2rsawseenar2rsawseen Maintainer
    @somezombiegm it seems to me that you are using old facebook plugin?
  • ar2rsawseenar2rsawseen Maintainer
    unfortunately it uses deprecated graph api, which won't work in some cases, maybe thats why you are getting such errors.

    It is suggested to move to the one provided with Gideros in All Plugins folder
  • somezombiegmsomezombiegm Member
    edited May 2015
    Ok, so I downloaded Gideros v2014.10 and used the facebook plugin on All Plugins folder. I got the same results :(.

    I tested again the same code:
    facebook:graphRequest(conf.facebookAppId.."/scores")
    Here I print the response:
    facebook:addEventListener(Event.REQUEST_COMPLETE, function(e)
    	print(e.response) 
    end)
    Which prints only my score:
    {"data":[{"user":{"id":"xxx","name":"Oscar Colmenares"},"score":55,"application":{"name":"Oscar Test App","id":"xxx"}}]}
    I also tried this to see if I could find my friends:
    facebook:graphRequest("me/friends")
    But got nothing when I printed the response:
    {"data":[]}
  • ar2rsawseenar2rsawseen Maintainer
    are you sure its not just only your score there?
  • SinisterSoftSinisterSoft Maintainer
    edited May 2015
    @somezombiegm is your app approved properly on the fb website? If not thenyou might have to add your friends as testers until it is?

    Plus if the id is the id of the game then it may only give you a list of friends who have installed the game - not a list of friends of yours...
    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
  • Thanks for the quick response, I couldn't answer sooner cause my internet went down.

    @ar2rsawseen that is my score. i want to find a way to get my friends and my own score.

    @SinisterSoft My app is not approved, I added friends as testers and administrators. On the id I tried my app's id and my account's id and got the same results always.
  • SinisterSoftSinisterSoft Maintainer
    edited May 2015
    I have it working fine on Android - just tested again - scores are coming through for me.

    My app is approved though.
    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
    edited May 2015
    If you use facebook:graphRequest("me/friends") then you will receive your friends that are using your app. If no friend uses your app then it will return an empty list. It is correct, you can not get all friends.
  • somezombiegmsomezombiegm Member
    edited May 2015
    @jdbc So how does facebook establish that someone used my app? I'm guessing is when someone logs to facebook from the app.
    facebook:setAppId("xxx")
    facebook:authorize({"publish_actions"})
    Cause I tried it logging in with two different users and always got empty data. Those users are friends.
  • jdbcjdbc Member
    edited May 2015
    @jdbc So how does facebook establish that someone used my app? I'm guessing is when someone logs to facebook from the app.
    facebook:setAppId("xxx")
    facebook:authorize({"publish_actions"})
    Cause I tried it logging in with two different users and always got empty data. Those users are friends.
    Use this:
    facebook:login(appId, {"public_profile", "user_friends", "publish_actions"})
    and
    facebook:graphRequest("me/friends")
    only returns friends that use your app not all friends.

    I have attached my social.lua file
    lua
    lua
    social.lua
    5K
  • somezombiegmsomezombiegm Member
    edited May 2015
    @jdbc I get this error:

    attempt to call method 'login' (a nil value) :(

    None of the other facebook methods I use have shown that error.
  • jdbcjdbc Member
    edited May 2015
    @jdbc I get this error:

    attempt to call method 'login' (a nil value) :(

    None of the other facebook methods I use have shown that error.
    May be I am using another Facebook Plugin version. This is the lastest Facebook plugin:

    https://github.com/gideros/giderosplugins/tree/master/Facebook

    This is the last Facebook example in the github:

    https://github.com/gideros/giderosplugins/blob/master/Facebook/examples/GiderosFacebook/main.lua

    but it seems to use facebook:login("352852401492555", {"public_profile", "user_friends", "publish_actions"})

    You should update your Facebook plugin to this one.
  • somezombiegmsomezombiegm Member
    edited May 2015
    @jdbc thanks, so I now have the new facebook plugin. And when testing that example I get the same error:
    main.lua:23: attempt to call method 'login' (a nil value)
    stack traceback:
    	main.lua:23: in main chunk
    I have the Gideros free licence. Does that have anything to do? or what could it be?
  • ar2rsawseenar2rsawseen Maintainer
    @somezombiegm interesting, for some reason then it seems it is still an old plugin, as old one had authorize method and new one has login method
  • Well, authorize works for me just fine. I was trying the login method because I wanted to see if I could get my friends data
    facebook:graphRequest("me/friends")
    but it always prints
    {"data":[]}
    If a friend and I both open the game and login to facebook via facebook:authorize... shouldn't the friends request method print something other than empty data? because we would be friends who use the same app/game.
  • somezombiegmsomezombiegm Member
    edited May 2015
    @ar2rsawseen Old plugin should still work, I think it could get friends data just fine, I might be doing something wrong :(... Or maybe I should still look for the new plugin elsewhere?
  • ar2rsawseenar2rsawseen Maintainer
    what I mean is that
    old plugin uses authorize and does not have a login methods
    while new plugin uses login method and does not have an authorize method

    so if in your code authorize method exists and login method does not exist, it means you are using old facebook plugin.

    new one should be in your Gideros installation directory/All Plugins/Facebook/bin/Android for Android
    and Gideros installation directory/All Plugins\Facebook\source\iOS for ios
  • somezombiegmsomezombiegm Member
    edited May 2015
    @ar2rsawseen I see the libfacebook.so files, those are the ones I am using. And I have the latest version of Gideros. The authorize method still works and the login method doesn't.

    So I guess the plugin on that address should be the old one then... In my case at least :(
  • simwhisimwhi Member
    @somezombiegm Gideros is now open source. The licence is not the issue.
  • ar2rsawseenar2rsawseen Maintainer
    @somezombiegm maybe try uninstalling and reinstalling Gideros, maybe it does not override files
  • somezombiegmsomezombiegm Member
    edited May 2015
    Thanks a lot for your help, I didn't want this to go so off topic from the original post.

    @simwhi ok.

    @ar2rsawseen I uninstalled and reinstalled Gideros yesterday. I'm now gonna try a different SDK. But I can't manage to import it http://stackoverflow.com/questions/30077892/cant-import-a-project-to-eclipse-facebook-sdk

    The one I am using right now is this one: https://github.com/gideros/giderosplugins/tree/master/Facebook/dependencies.
Sign In or Register to comment.