Uploaded image for project: 'Appcelerator Modules'
  1. Appcelerator Modules
  2. MOD-2280

Facebook: fb.permissions leading to crash inconsistently on iOS

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 6.0.0
    • Component/s: Facebook
    • Labels:
      None
    • Environment:

      SDK 5.3.1.GA
      Facebook 5.2.0
      iOS 9.3

    • Story Points:
      7
    • Sprint:
      2016 Sprint 17 SDK

      Description

      Reproduce

      1. Run the following code in a simple classic project.

      var win = Ti.UI.createWindow({
      	backgroundColor: "white",
      });
       
      // facebook
      var fb = require('facebook');
      fb.initialize();
      fb.addEventListener('login', function(e) {
          if (e.success) {
              Ti.API.info('login from uid: '+e.uid+', name: '+ JSON.parse(e.data).name);
              checkPermission();
          }
          else if (e.cancelled) {
              alert('cancelled');
          }
          else {
              alert(e.error);
          }
      });
       
      // button to tigger facebook authorise and check the permission
      var button = Ti.UI.createButton({
      	title:"Authorise and check the permission",
      	top: 100
      });
      button.addEventListener('click',function(e){
      	if (!fb.loggedIn) {
      		console.log("not logged yet.");
      		fb.authorize();
      	} else {	
      		checkPermission();
      	}
      });
      win.add(button);
       
      function checkPermission() {
      	if(fb.permissions.indexOf('publish_actions') < 0) {
      		Ti.API.info("No publish_action permission");
      	} else {
      		Ti.API.info("Do have publish_action permission");
      	}
      }
       
      win.open();
      

      2. Click the button to login/authorise.
      3. Then click it again to check permissions.

      Problem.

      App will cash if you click the button for several times.

      Note

      No any crash log in console.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hknoechel Hans Knöchel
                Reporter:
                sliang Shuo Liang
                Reviewer:
                Chee Kiat Ng (Inactive)
                Tester:
                Harry Bryant
              • Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code