Titanium

[MOD-2247] Ti.Facebook iOS: Native login not working

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionNot Our Bug
Resolution Date2016-04-20T12:49:49.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsFacebook
Labelsfacebook, ios
ReporterHans Knöchel
AssigneeChee Kiat Ng
Created2016-04-20T07:16:25.000+0000
Updated2016-04-20T12:49:55.000+0000

Description

The current default behavior - logging into Facebook using the Facebook app - doesn't seem to work anymore. Reproduce:
<ios>
	<plist>
		<dict>
			<key>CFBundleURLTypes</key>
			<array>
				<dict>
					<key>CFBundleURLName</key>
					<string>com.appc.test</string>
					<key>CFBundleURLSchemes</key>
					<array>
						<string>app_slug</string>
						<string>fb<fb-app-id></string>
					</array>
				</dict>
			</array>
			<key>FacebookAppID</key>
			<string><fb-app-id></string>
			<key>FacebookDisplayName</key>
			<string>SomeName</string>
			<key>LSApplicationQueriesSchemes</key>
			<array>
				<string>fbapi</string>
				<string>fbapi20130214</string>
				<string>fbapi20130410</string>
				<string>fbapi20130702</string>
				<string>fbapi20131010</string>
				<string>fbapi20131219</string>    
				<string>fbapi20140410</string>
				<string>fbapi20140116</string>
				<string>fbapi20150313</string>
				<string>fbapi20150629</string>
				<string>fbauth</string>
				<string>fbauth2</string>
				<string>fb-messenger-api20140430</string>
			</array>
		</dict>
	</plist>
</ios>
var win = Ti.UI.createWindow({
  backgroundColor : "#fff"
}); 
var btn = Ti.UI.createButton({
  title : "Login with Facebook"
});
var fb = require('facebook');
fb.initialize();

fb.addEventListener("login", function(e) {
    Ti.API.warn(e);
    if(!e.success) {
        return;
    }
    alert("loggedin");
})

btn.addEventListener("click", function() {    
    fb.permissions = ['email'];
    fb.authorize();
});

win.add(btn);
win.open();

Comments

  1. Chee Kiat Ng 2016-04-20 Going to need more details. Need to know if this is a regression or not. What's the Ti SDK, xCode and Facebook modules version.
  2. Hans Knöchel 2016-04-20 Details provided above. Also create a native application following the Facebook docs best practice: https://www.dropbox.com/s/covkst64flicd9x/test.zip?dl=0 It behaves the same, so either we are missing something or the native app-switch is currently broken in the Facebook SDK.
  3. Hans Knöchel 2016-04-20 As discussed in this thread, it seems like Facebook wants to use the Safari Dialog ("browser") behavior by default, even when we set the fb.LOGIN_BEHAVIOR_NATIVE which was exposed in MOD-2242. So it's a Facebook "issue" which is being looked into on their side. For now, we can close this issue and leave it for further reference.

JSON Source