keiby
November 2, 2016, 1:16pm
1
Hi!
I need some help with the UNO External Object.
I’m currently trying console.log(JSON.stringify(token))
and console.dir(token)
but it return {}
.
How I get access this Object in JavaScript?
What is the correct syntax for that?
MainView.ux
var FacebookLogin = require("FacebookLogin");
var Observable = require("FuseJS/Observable");
var message = o('Nothing...')
function login() {
FacebookLogin.login().then(function(token) {
message.value = "Login successful"
console.log(JSON.stringify(token))
console.dir(token)
}, function(err) {
message.value = "Login failed: " + err
});
}
module.exports = {
message: message,
login: login
};
I need to use next parameters:
userID
, permissions
, tokenString
, expirationDate
from FBSDKAccessToken (link) from JS.
FacebookLogin/FacebookLoginModule.uno
External Converter(Context context, FacebookLogin.AccessToken accessToken)
{
return new External(accessToken);
}
Thank you!
Bent
November 2, 2016, 1:19pm
2
keiby
November 2, 2016, 1:24pm
3
Bent Stamnes wrote:
Perhaps this can offer some hints? GitHub - bolav/fuse-facebook
Thanks, but not good enough for me:
Only iOS support for now. (Android on the list).
Only FB-button support. (Custom button coming).
Bent
November 2, 2016, 1:26pm
4
Didn’t mean it was complete, just that it could possibly help with your implementation.
keiby
November 2, 2016, 1:32pm
5
Bent Stamnes wrote:
Didn’t mean it was complete, just that it could possibly help with your implementation.
I like the cross-platform solution from the Fuse team (link) . But I can’t obtain the necessary data from JS.
Can you recommend something?
Hey Keiby,
The way External
works is that it’s a JS object that holds a reference to an Uno object, but it’s completely opaque on the JS side. This means that you can’t really do anything with it other than pass it around on the JS side. So what you’ll have to do is to pass it to one or several Uno methods, exposed to JavaScript, that extract the information that you need.
I hope that made sense!
Cheers!