Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3211] iOS: Facebook module loggedIn never true when Safari restricted

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T02:01:11.000+0000
Affected Version/sn/a
Fix Version/sSprint-2011-08
ComponentsiOS
Labelsdefect, facebook, ios, release-1.6.1, release-1.7.0, rplist
ReporterJon Alter
AssigneeRalf Pfeiffer
Created2011-04-15T03:39:36.000+0000
Updated2011-04-17T02:01:11.000+0000

Description

When you restrict Safari and authorize() or us the facebook button, everything seems to work properly but loggedIn is never true and the facebook button never changes to 'logout'

Step 0: restrict Safari via (Settings>General>Restrictions)
Step 1: install app
Step 2: click the 'loggedIn' button
Step 3: Label says false
Step 4: click 'authorize()' or Facebook button and login
Step 5: notice FB button still says Login
Step 6: click the 'loggedIn' button
Step 7: Label says false

var win = Titanium.UI.createWindow({  
    backgroundColor:'#fff'
});

Titanium.Facebook.appid = '187692147928682';
Titanium.Facebook.permissions = ['publish_stream'];

var statusLabel = Ti.UI.createLabel({
    text: 'click status',
    top: 0,
    width: 300,
    height: 60
});

var statusButton = Titanium.UI.createButton({
    title: 'loggedIn',
    bottom: 300,
    width: 300,
    height: 60
});
statusButton.addEventListener('click', function(e) {
    Ti.API.info('Facebook loggedIn: '+Ti.Facebook.loggedIn);
    statusLabel.text = 'Facebook loggedIn: '+Ti.Facebook.loggedIn;
});

var fbAuthButton = Titanium.UI.createButton({
    title: 'authorize()',
    bottom: 100,
    width: 300,
    height: 60
});
fbAuthButton.addEventListener('click', function(e) {
    Titanium.Facebook.authorize();
});

var fbButton = Titanium.Facebook.createLoginButton({
    'style': 'wide',
    'sessionProxy': 'http://api.appcelerator.net/p/fbconnect/',
    bottom: 50,
    height: 30,
    width: 300
});

win.add(statusLabel);
win.add(statusButton);
win.add(fbAuthButton);
win.add(fbButton);
win.open();

Tested on

TiSDK 1.6.0GA, iOS 4.2.1, iPhone4

Associated Helpdesk Ticket

http://developer.appcelerator.com/helpdesk/view/75411">http://developer.appcelerator.com/helpdesk/view/75411

Comments

  1. Jon Alter 2011-04-15

    You will need to copy Info.plist to the root dir of your project and You’ll need to edit the CFBundleURLSchemes array to include the URL that Facebook uses to restart your app after login is completed:

               <key>CFBundleURLSchemes</key>
               <array>
                       ... OTHER URL SCHEMES HERE ...
                       <string>fb187692147928682</string>
               </array>
       
  2. Stephen Tramer 2011-04-15

    Unable to duplicate outside Titanium as an Apple bug. But filed a bug with facebook: http://bugs.developers.facebook.net/show_bug.cgi?id=15427">http://bugs.developers.facebook.net/show_bug.cgi?id=15427

  3. Jeff Haynie 2011-04-15

    (from [5c7aa560eeb4f35ae3765e1c1aca4112f796e8b7]) [#3211 state:fixed-in-qa] Patched the Facebook iOS SDK to properly handle redirects to the app requesting authorization. https://github.com/appcelerator/titanium_mobile/commit/5c7aa560eeb4f35ae3765e1c1aca4112f796e8b7"> https://github.com/appcelerator/titanium_mobile/commit/5c7aa560eeb4...

  4. Thomas Huelbert 2011-04-15

    [INFO] Titanium SDK version: 1.7.0 (02/25/11 08:42 8a239f5) iphone 4 (4.2.1), more testing needed before closing

  5. Jeff Haynie 2011-04-15

    (from [166e80359cd31faf017680ad4a20d9fc0e5a0e30]) [#3211 state:fixed-in-qa] Patched the Facebook iOS SDK to properly handle redirects to the app requesting authorization. https://github.com/appcelerator/titanium_mobile/commit/166e80359cd31faf017680ad4a20d9fc0e5a0e30"> https://github.com/appcelerator/titanium_mobile/commit/166e80359cd3...

  6. Thomas Huelbert 2011-04-15

    fix looks good on 4.01-4.2.1, but still seeing the bad behavior (fb button not reflecting log in status) on 3.1.3

  7. Jeff Haynie 2011-04-15

    (from [e7e8f673a79528456cec1493e0013f0db884bc6f]) [#3211] Fix for 3.1.x login auth. https://github.com/appcelerator/titanium_mobile/commit/e7e8f673a79528456cec1493e0013f0db884bc6f"> https://github.com/appcelerator/titanium_mobile/commit/e7e8f673a795...

  8. Jeff Haynie 2011-04-15

    (from [547be3825a21e9572a55452d86892e0f4cbfff0d]) [#3211] Fix for 3.1.x login auth. https://github.com/appcelerator/titanium_mobile/commit/547be3825a21e9572a55452d86892e0f4cbfff0d"> https://github.com/appcelerator/titanium_mobile/commit/547be3825a21...

  9. Natalie Huynh 2011-04-15

    Tested with Titanium SDK version: 1.7.0 (03/02/11 13:57 5d8c78a)
    iPhone 3g 3.1.2
    iPhone 4 4.2.1

  10. Don Thorp 2011-04-15

    This was fixed after 1_6_1_GA so changed release tag to release-1.6.1 and added release-1.7.0

JSON Source