<commit_before>var Cloud = require('ti.cloud');

var fb = require('facebook');
Titanium.Facebook.appid = "320766681373313";//Production
Titanium.Facebook.permissions = ['publish_stream', 'read_stream'];
 


var win = Ti.UI.currentWindow;

win.backgroundColor = '#fff';
 
var campusTapsLogo = Ti.UI.createImageView({
	image: '/images/campusTapsLogo.png',
	top: 60,
	width: 300,
	height: 100
});
win.add(campusTapsLogo); 
 
var fbSignupBtn = Ti.Facebook.createLoginButton({
    bottom: 50,
    style : Ti.Facebook.BUTTON_STYLE_WIDE
});
win.add(fbSignupBtn);



 
 Titanium.Facebook.addEventListener('login', function(e) {
	if (e.success) {
		Cloud.SocialIntegrations.externalAccountLogin({
			type : 'facebook',
			token : Ti.Facebook.accessToken
		}, function(e) {
			
			if (e.success) {
				var user = e.users[0];
				Ti.API.info('User  = ' + JSON.stringify(user));
				Ti.App.Properties.setString('currentUser_id', e.id);
				Ti.App.Properties.setString('session_id', Cloud.sessionId);
				Ti.App.Properties.setString('username', e.username);
				Ti.API.info('Success: ' + 'id: ' + user.id + '\\n' + 'first name: ' + user.first_name + '\\n' + 'last name: ' + user.last_name);
				
				win.close();			
			} else {
				alert('Error: ' + ((e.error && e.message) || JSON.stringify(e)));
				
			}
		});
	} else if (e.error) {
		alert("Error = " + e.error);
	} else if (e.cancelled) {<commit_msg>iOS7 - 3.1.3.GA - Facebook module changed, login dialog works without problems<commit_after>var Cloud = require('ti.cloud');

var fb = require('facebook');
fb.appid = "125520310866488";//Production
fb.permissions = ['read_stream'];
fb.forceDialogAuth = true;


var win = Ti.UI.currentWindow;

win.backgroundColor = '#fff';
 
var campusTapsLogo = Ti.UI.createImageView({
	image: '/images/campusTapsLogo.png',
	top: 60,
	width: 300,
	height: 100
});
win.add(campusTapsLogo); 
 
var fbSignupBtn = fb.createLoginButton({
    bottom: 50,
    style : Ti.Facebook.BUTTON_STYLE_WIDE
});
win.add(fbSignupBtn);



 
 fb.createLoginButton.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('currentUser_id', e.id);
				Ti.App.Properties.setString('session_id', Cloud.sessionId);
				Ti.App.Properties.setString('username', e.username);
				Ti.App.Properties.setString('photo', e.photo);
				Ti.API.info('Success: ' + 'id: ' + user.id + '\\n' + 'first name: ' + user.first_name + '\\n' + 'last name: ' + user.last_name);
				
								win.close();

						
			} else {
				alert('Error: ' + ((e.error && e.message) || JSON.stringify(e)));
				
			}
		});
	} else if (e.error) {
		alert("Error = " + e.error);
	} else if (e.cancelled) {
{'fraction_non_alphanumeric': 0.17783952761375477, 'fraction_numerical': 0.019451198332754428, 'mean_word_length': 3.5354330708661417, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3696262', 'n_tokens_mistral': 1230, 'n_tokens_neox': 1024, 'n_words': 180}