Titanium JIRA Archive
Alloy (ALOY)

[ALOY-736] Alloy: Twitter builtin does not close loading popup after login

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-11-26T02:20:10.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.4.0, 2014 Sprint 08
ComponentsBuiltins
Labelsqe-noTestNeeded, supportTeam
ReporterRupesh Sharma
AssigneeTim Poulsen
Created2013-07-03T10:41:00.000+0000
Updated2014-11-26T02:20:10.000+0000

Description

Description

Alloy social builtin for twitter when used in the app it does not allow to close the loading popup after login.

Test case

var social = require('alloy/social').create({
    consumerSecret: '',
    consumerKey: ''
});

// If not authorized, get authorization from the user
if(!social.isAuthorized()) { 
    social.authorize();
}

// Post a message
// Setup both callbacks for confirmation
social.share({
    message: "Salut, Monde!",
    success: function(e) {alert('Success!')},
    error: function(e) {alert('Error!')}
}); 

// Deauthorize the application
social.deauthorize();
Please see the attached screenshot for the issue.

Attachments

FileDateSize
Screen Shot 2013-06-28 at 4.40.01 PM.png2013-07-03T10:41:00.000+000068547

Comments

  1. josh rose 2013-08-19

    Also seeing this issue. Ti 3.1.1
  2. David Knell 2013-08-26

    I had this same issue and was banging my head against the desk trying to figure this out. Then I looked in the social.js file and found the answer. Basically, you should use authorize() *OR* share() in the same code block - *NOT* both. The share() function actually calls authorize itself which opens the authorizeUI AND the loadingUI (which is the screen in your screenshot). Then when you call share(), it calls authorize() again and opens another instance of authorizeUI and loadingUI and the code is not cleaning up both instances. The example and documentation should really make this more clear. If you change your code to the following, your user will still be asked to authenticate, if they are not already, and your problem should be solved.
       var social = require('alloy/social').create({
           consumerSecret: '',
           consumerKey: ''
       });
        
       // Post a message
       // Setup both callbacks for confirmation
       social.share({
           message: "Salut, Monde!",
           success: function(e) {alert('Success!')},
           error: function(e) {alert('Error!')}
       }); 
       
       
    Hope that helps... Dave
  3. Tim Poulsen 2014-03-10

    Updated the docs to clarify. https://github.com/appcelerator/alloy/pull/345

JSON Source