make access token available in facebook plugin pls

0 favourites
  • 14 posts
From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • Hi,

    I just noticed there is no "get access token" expression in facebook plugin. You know what would be great? I it was available. You know why? Cos you could do lots of things with it, you could use the whole open graph functionality, which would make (for advanced users like myself :) all of it available. The other thing that would be great - a custom set of permissions (as a string maybe?). Say, I want to get user's bio - i need a "user_about_me" permission + access token and send ajax it to graph.facebook.com/username

    right now there is no way to do it.

    Ashley are there any plans for it in near future? Pretty please and lots of love! :)

  • also +1 for making dictionary object accept multilevel dictionaries or some kind of multilevel json parsing, right now facebook returns:

    {
      "id": "1234",
      "picture": {
        "data": {
          "url": "https://fbcdn-profile-a.akamaihd.net/profilepicture.jpg",
          "is_silhouette": false
        }
      }
    }

    and there is no easy way (without using tokens, which can brake later when facebook changes something) to access the data part of this object.

    and yes, you can just get the graph.facebook.com/1234/picture directly, but the above code was just to illustrate the problem with json :)

    edit: no you actually cannot, as the above picture address is a redirect to the actual jpeg and for some reason, construct does not display the profile picture.

  • I have a Facebook addon plugin with the access token. Search Facebook 2 and you should be able to find it. I'm on my iPad or I'd link it for you, sorry. :(

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • there is no way to use it in the arcade though, so it is useless for me, but great plugin nevertheless, great work, keep it up!

  • ranma,

    I think I remember reading that only official plugins are allowed. I think it's agreed most people should never adjust official plugins for fear of ruining the plugin I seem to remember you know your way around the SDK. Would it work to open up my updated plugin and cut out the reference for user token and plug it into your official plugin?

  • I think I remember reading that only official plugins are allowed.

    yes, using plugins that did not come with construct instalation will not let you upload your game to arcade.

    I think it's agreed most people should never adjust official plugins for fear of ruining the plugin I seem to remember you know your way around the SDK. Would it work to open up my updated plugin and cut out the reference for user token and plug it into your official plugin?

    adjusting official plugin and uploading the game to arcade will let you upload the game, but will break it, as in the arcade plugins are in their original form, not the uploaded one, so the game will work locally with modified original plugin, but will not after it's uploaded.

    also this is not the main problem, main problem is that both official plugins (dictionary and facebook) are lacking some basic and very needed functionalities. also the facebook plugin uses app secret to post scores, which is a very bad idea, as application secret should NEVER be used nor it souldn't be available client side (which javascript is) so actually every game that uses the score posting of the official facebook plugin is wide open to hacking it.

  • ranma

    Thats agreed completely. I've been adjusting the official plugin to suite my needs and avoid the app secret. I'm actually in the process of redesigning the whole plugin from scratch. A lot of the breaking changes aren't compatible with the official plugin so at some point our apps will stop working. For example Facebook is now expecting that apps have the ability to handle denied permissions, the official plugin using the popup login isn't compatible with that so I updated my plugin so we have the ability to check for denied permissions through the url. I know what changes need to be made but I'm a father of 6 so time is valuable which translates into slow progress. We should get a group of knowledgeable people together and rebuild the whole plugin, test it as a group and present it to the Scirra team for consideration as replacement of the official plugin. It would take some stress off them so they can focus on the other improvements and give users the Facebook plugin we've been asking for.

  • ranma

    Thats agreed completely. I've been adjusting the official plugin to suite my needs and avoid the app secret. I'm actually in the process of redesigning the whole plugin from scratch. A lot of the breaking changes aren't compatible with the official plugin so at some point our apps will stop working. For example Facebook is now expecting that apps have the ability to handle denied permissions, the official plugin using the popup login isn't compatible with that so I updated my plugin so we have the ability to check for denied permissions through the url.

    totally true, that's the second priority reason for me I am posting this in hope this gets to master Ashley at some point :)

  • bumpidybump :( as the custom plugin still is not a solution (with arcade in mind)

  • ok, I managed to add the get access token expression to the official plugin, if Ashley could take a look, below is everything you need to add it to the official plugin in the next release maybe? :)

    edittime.js

    line 94:
    AddExpression(9, ef_return_string, "Get Access Token", "Facebook", "AccessToken", "Get the user's current access token.");

    runtime.js

    line 38:
    var fbAccessToken = "";
    line 113:
    fbAccessToken = response["authResponse"]["accessToken"];
    line 133:
    fbAccessToken = response["authResponse"]["accessToken"];
    line 462:
    Exps.prototype.AccessToken = function (ret)
         {
              ret.set_string(fbAccessToken);
         };

    that's it! 5 copy pastes, Ashley can we count on you? :) pleeeeeaaaaaaase, I'd love to publish my facebook integrated game to arcade, but I cannot because of this :( and also just imagin what kinds of features you're unlocking with this - every request to the graph api can now be made! retrieving friends, photo albums, videos, etcetc!

    and thanks go to of course :)

  • ranma I have a plugin with that, credits and quite a bit more. In fact feel free to grab it, polish it and use it ASHLEY.

  • but again, this is not acceptable in the arcade, mate :)

  • That's why I was thinking Ashley should grab it, tweak it and maybe use it to replace the core plugin. I've got it all in there, he should just have to tweak it with his far superior knowledge of js. That would be nice to have it all built into the core system.

  • and this is why I striped it down to these five copy pastes as everything else can be achieved when you have the access token, with ajax plugin that is already built in - true, you will have to tokenize responses, because there is no way to deserialize json received, but that is another thing.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)