Problem Description
When using externalAccountLogin and supplying 'first_name', 'last_name' capitalisation is removed, and those strings stored in all lower-case. Capitalisation is preserved in fields such as 'token' and custom_fields.
TEST CODE:
app.js
var Cloud = require('ti.cloud');
var fb = require('facebook');
fb.appid = "FB_App_ID";
fb.permissions = ['publish_stream', 'read_stream'];
var win = Ti.UI.createWindow({
title : "ACS Social Integrations"
});
var fbSignupBtn = Ti.UI.createButton({
title : "Login with Facebook",
width : 160,
top : 50
});
win.add(fbSignupBtn);
fbSignupBtn.addEventListener('click', function() {
if (!fb.loggedIn) {
fb.authorize();
}
});
fb.addEventListener('login', function(e) {
if (e.success) {
Cloud.SocialIntegrations.externalAccountLogin({
type : 'facebook',
token : fb.accessToken
}, function(e) {
if (e.success) {
var user = e.users[0];
Ti.API.info('User = ' + JSON.stringify(user));
Ti.App.Properties.setString('currentUserId', user.id);
alert('Success: ' + 'id: ' + user.id + '\\n' + 'first name: ' + user.first_name + '\\n' + 'last name: ' + user.last_name);
} else {
alert('Error: ' + ((e.error && e.message) || JSON.stringify(e)));
}
});
} else if (e.error) {
alert("Error = " + e.error);
} else if (e.cancelled) {
alert("canceld");
}
});
win.open();
STEPS TO TEST:
- Create a simple project.
- Update app.js with test code
- Add facebook and ti.cloud module
- Enable cloud service
- Run on android device/emulator
Actual Results
The fields lost the capitalization.
Mauro, Is there any update on this? I'm unable to view that status on the Cloud-ticket due to insufficient permissions. Thanks
This is an existing bug and we plan to fix it in future releases.
@Shak What is the existing ticket number? This ticket has been open for over a year, been assigned to multiple people, and only now being noticed as duplicate?