I am not able to get user public_profile info and email in Facebook module. Facebook module Version 4.0.5 Titanium sdk 4.1.0 I have followed all steps described on documentation. Appcelerator Documentation
But only able to get name and id. Although i am able to get email and public_profile information in iOS using FB module 4.0.5. But not succeeded in Android. Is something changed recently or i am doing it in wrong way. These permissions i am using:
fb.permissions = ['public_profile', 'email'];
And requesting is through graphAPI.
exports.loginWithFb = function(callback) {
fb.addEventListener('login', function(e) {
if (e.success) {
Ti.API.error('from facebook success');
fb.requestWithGraphPath("me", {}, 'GET', function(e) {
Ti.API.error("from info success: " + JSON.stringify(e.result));
var data = JSON.parse(e.result);
callback(data);
});
} else if (e.error) {
Ti.API.error('error in fb login: ' + JSON.stringify(e.error));
callback(e);
} else if (e.cancelled) {
Ti.API.error('login cancelled: ' + JSON.stringify(e.error));
callback(e);
}
});
fb.authorize();
};
And for iOS i used graph API in this way.
fb.requestWithGraphPath("me?fields=name,email,first_name,last_name", {}, 'GET', function(e) {
Ti.API.error("from info success: " + JSON.stringify(e.result));
var data = JSON.parse(e.result);
callback(data);
});
But same graph API call not executing for Android. Throwing exception of undefined token.