Titanium JIRA Archive
Appcelerator Community (AC)

[AC-499] Facebook no longer works - fbauth2 is missing from your info.plist

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-11-23T07:11:46.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterJosh Lewis
AssigneeSharif AbuDarda
Created2015-11-12T00:12:37.000+0000
Updated2015-11-23T07:11:46.000+0000

Description

Facebook no longer works on iOS9. Trying to login, the following message appears: ~~~ fbauth2 is missing from your Info.plist under LSApplicationQueriesSchemes and is required for iOS 9 ~~~ Adding the suggested fix keeps the app from crashing, loads Facebook for login and comes back to the app, but then does not go further and actually do anything.

Comments

  1. Sharif AbuDarda 2015-11-16

    Hello [~joshlewis], Looks like your Facebook authentication is missing from your tiapp.xml file, Which is [additional iOS setup steps](http://docs.appcelerator.com/platform/latest/#!/api/Modules.Facebook). Add the following keys: 1. FacebookAppID key with your Facebook App ID as the string value. 2. FacebookDisplayName key with your Facebook App name (the one from developer.facebook.com) as the string value. 3. CFBundleURLTypes key with a single-element array containing a dict as the value, where the dict contains: * CFBundleURLName key with the application app ID (same value as the id in the tiapp.xml file) as the string value. * CFBundleURLSchemes key with a single-element array containing the Facebook App ID prefixed with fb as a string value. For example:
           <ti:app>
               <ios>
                   <plist>
                       <dict>
                           <key>CFBundleURLTypes</key>
                           <array>
                               <dict>
                                   <key>CFBundleURLName</key>
                                   <!-- Application ID same as the id value in the tiapp.xml file -->
                                   <string>APP_ID</string>
                                   <key>CFBundleURLSchemes</key>
                                   <array>
                                       <!-- Prefix the Facebook App ID with 'fb' -->
                                       <string>fbFACEBOOK_APP_ID</string>
                                   </array>
                               </dict>
                           </array>
                           <key>FacebookAppID</key>
                           <!-- Facebook App ID -->
                           <string>FACEBOOK_APP_ID</string>
                           <key>FacebookDisplayName</key>
                           <!-- Facebook App Name from developer.facebook.com -->
                           <string>FACEBOOK_APP_NAME</string>
                       </dict>
                   </plist>
               </ios>
           </ti:app>
       
    This should work for you. I have tested it, And it's working. Hope this helps, Thanks.
  2. Josh Lewis 2015-11-16

    Still doesn't work in the 5.x sdk. Also, apparently in 4.x now, the data from the fb 'login' event listener has to be json-parsed now. Calling e.data.email equals null, but calling var x = JSON.parse(e.data);alert(x.email); works...
  3. Motiur Rahman 2015-11-23

    Hi [~josh.lewis], We can successfully login Facebook with the following version. Login problem can happen because of your Facebook APPID is not created with the updated version or you didn't follow all the steps. Also, the plist file of your tiapp.xml is not well prepared. So I recommend you to create Fb_ID *developers.facebook.com* with updated version and follow all the steps and follow this guide also - http://docs.appcelerator.com/platform/latest/#!/api/Modules.Facebook *Testing Environment:* Operating System Name = Mac OS X Version = 10.11.1 Architecture = 64bit # CPUs = 4 Memory = 8589934592 Node.js Node.js Version = 4.2.2 npm Version = 3.4.1 Titanium CLI CLI Version = 5.0.5 Titanium SDK SDK Version = 5.1.0.GA, 5.0.2.GA Target Platform = iphone *Test Code:*
       // Don't forget to set your requested permissions, else the login button won't be effective.
       var win = Ti.UI.createWindow({
       	backgroundColor : 'white'
       });
       var fb = require('facebook');
       
       fb.addEventListener('login', function(e) {
       	if (e.success) {
       		alert('Logged in');
       	}
       });
       fb.addEventListener('logout', function(e) {
       	alert('Logged out');
       });
       
       if (Ti.Platform.name === 'android') {
       	win.fbProxy = fb.createActivityWorker({
       		lifecycleContainer : win
       	});
       }
       
       // Add the button.  Note that it doesn't need a click event listener.
       win.add(fb.createLoginButton({
       	readPermissions : ['user_friends','email'],
       	top : 50
       }));
       
       win.open();
       
    Thanks

JSON Source