make access token available in facebook plugin pls

Discussion and feedback on Construct 2

Post » Thu Feb 07, 2013 6:16 pm

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 https://graph.facebook.com/username/?fields=bio&access_token=accesstokenhere

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! :)
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Thu Feb 07, 2013 7:16 pm

also +1 for making dictionary object accept multilevel dictionaries or some kind of multilevel json parsing, right now facebook returns:
[code]{
"id": "1234",
"picture": {
    "data": {
      "url": "https://fbcdn-profile-a.akamaihd.net/profilepicture.jpg",
      "is_silhouette": false
    }
}
}[/code]
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 https://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.ranma2013-02-07 21:24:01
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Thu Feb 07, 2013 11:29 pm

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. :(
B
68
S
21
G
15
Posts: 701
Reputation: 15,604

Post » Fri Feb 08, 2013 9:33 am

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!
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Fri Feb 08, 2013 3:13 pm

@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?
B
68
S
21
G
15
Posts: 701
Reputation: 15,604

Post » Fri Feb 08, 2013 3:49 pm

[QUOTE=lanceal] I think I remember reading that only official plugins are allowed.[/QUOTE]

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

[QUOTE=lanceal] 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?[/QUOTE]

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.
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Fri Feb 08, 2013 5:07 pm

@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.

B
68
S
21
G
15
Posts: 701
Reputation: 15,604

Post » Fri Feb 08, 2013 5:40 pm

[QUOTE=lanceal] @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. [/QUOTE]
totally true, that's the second priority reason for me I am posting this in hope this gets to master @Ashley at some point :)
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Tue Feb 26, 2013 3:14 pm

bumpidybump :( as the custom plugin still is not a solution (with arcade in mind)
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Wed Feb 27, 2013 3:23 pm

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
[code]line 94:
AddExpression(9, ef_return_string, "Get Access Token", "Facebook", "AccessToken", "Get the user's current access token.");[/code]

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

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 @lanceal of course :)ranma2013-02-27 15:25:24
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Next

Return to Construct 2 General

Who is online

Users browsing this forum: eli0s, Lof, RageByte and 8 guests