fuse-open / fuse-samples

A collection of smaller examples using the various features of Fuse and FuseJS
MIT License
182 stars 153 forks source link

Feature native facebook login with user info #39

Closed jesusmartinoza closed 7 years ago

jesusmartinoza commented 7 years ago

Get user info using GrapRequest in Android and iOS

    var FacebookLogin = require("FacebookLogin");

    FacebookLogin.login().then(function(user) {
      console.log(JSON.stringify(user));
      // {"id":"XXXXXXXXX","email":"XXXX@hotmail.com","name":"Jesus Martínez"}
    }, function(err) {
      console.log("Login failed: " + err);
    });
ollef commented 7 years ago

Hey Jesús!

This looks nice. A problem with adding the usage of the Graph API is that the code starts to deviate too much from the tutorial. The intention of #35 was to add some JavaScript functions that take the AccessToken as argument and return some of the fields from that, while here you're doing something slightly different.

Perhaps a better idea would be for you to maintain this extended version of the example in a separate repository that we could then link to from this one?

Cheers!

jesusmartinoza commented 7 years ago

Oh I understand. Maybe another option is use the user object as second parameter like this...

var FacebookLogin = require("FacebookLogin"); 

FacebookLogin.login().then(function(accessToken, user) {
  console.log(JSON.stringify(user));
  //{"id":"XXXXXXXXX","email":"XXXX@hotmail.com","name":"Jesus Martínez"}
 }, function(err) {
  console.log("Login failed: " + err); 
}); 

Anyway the extended version in a separate repository is OK for me. (: