Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-15258

iOS: Facebook module throws "FBSession: should only be used from a single thread" error on reviving app with Facebook request URL


    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: iOS
    • Environment:

      MacOS X 10.8.4
      Titanium CLI version 3.1.2, Titanium SDK version 3.1.2.GA
      iOS SDK: 6.1 and 7.0
      Xcode 4.6.3 and 5-DP6
      Titanium's Facebook module 3.1.1

    • Story Points:
    • Sprint:
      2016 Sprint 17 SDK


      Test case:

      1. login into Facebook using your Titanium's app
      2. kill it from Dock
      3. try to open app with Facebook user-to-user request URL from your notifications section in Facebook or newsfeed story. It should be something like fb116843021780929://authorize?...
      4. "FBSession: should only be used from a single thread" red screen appears

      XCode console on a device says:

      Sep 10 12:40:08 iPhone Printpie[31305] <Warning>: *** Assertion failure in -[FBSession handleOpenURL:], /Volumes/Datums/CodeValhalla/Github/Mine/titanium_modules/facebook/mobile/ios/Classes/FBConnect/FBSession.m:426
      Sep 10 12:40:08 iPhone Printpie[31305] <Warning>: [ERROR] Script Error FBSession: should only be used from a single thread

      Test application code is simple as a child's tear:

      var fb = require('facebook');
      fb.appid = '116843021780929';
      var win = Ti.UI.createWindow();
      var loginButton = Ti.UI.createButton({
          title: 'Login'
      loginButton.addEventListener('click', function(){fb.authorize();});

      Don't forget to add into your Info.plist next string for Facebook URL chema support:



      1. run the app
      2. click "Login" button
      3. login into your Fb account
      4. you will be bring back to the app
      5. close simulator
      6. open simulator stand-alone, without titanium
      7. try next URL (it's similar as from Facebook native app or Safari's web-version of FB):


      8. you will see "FBSession: should only be used from a single thread"

      I saw many similar questions on Q&A section with no answers

      P.S. sorry, no time to make a bundle with test application, but I hope I explained it above.




            • Assignee:
              emerriman Eric Merriman
              bobrosoft Vladimir Tolstikov
            • Watchers:
              0 Start watching this issue


              • Created:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  Sync status:
                  Last received:
                  Last sent:

                  Git Integration