Closed GoogleCodeExporter closed 8 years ago
I think it should be a static method in FacebookClient.AccessToken class. Maybe
it can be called just valueOf()?
Original comment by egor@technoparkcorp.com
on 10 Nov 2011 at 8:35
As a workaround, you should be able to say
AccessToken accessToken = new DefaultJsonMapper().toJavaObject(json,
AccessToken.class);
...is that sufficient for what you're trying to do?
Thanks for using RestFB!
Original comment by m...@xmog.com
on 10 Nov 2011 at 6:02
This is what I'm doing now:
String response = "access_token=....&expires=....";
final String[] sectors = response.split("&");
for (String sector : sectors) {
final String[] pair = sector.split("=");
if (pair.length != 2) {
throw new IOException("invalid format");
}
if ("access_token".equals(pair[0])) {
return pair[1];
}
}
Would be much better to have a static method for FacebookClient.AccessToken
creation. And besides that would be nice to let DefaultFacebookClient accept an
instance of FacebookClient.AccessToken in constructor.
Original comment by egor@technoparkcorp.com
on 10 Nov 2011 at 6:15
Ah, OK! I didn't realize you meant parsing it out of a URL parameter string.
And good idea to allow DefaultFacebookClient accept an AccessToken in a new
ctor. Thanks.
Original comment by m...@xmog.com
on 10 Nov 2011 at 6:19
It's a long time coming!
This has been implemented as the static method AccessToken.fromQueryString()
here:
https://github.com/revetkn/restfb/commit/a77325b0cc401d9d095c8804f545f59ed03df79
0
Thank you!
Original comment by m...@xmog.com
on 2 Sep 2012 at 4:37
Thanks!
Original comment by egor@technoparkcorp.com
on 2 Sep 2012 at 4:39
Original issue reported on code.google.com by
egor@technoparkcorp.com
on 10 Nov 2011 at 8:34