Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2734] android facebook query fails after login event is fired.

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-07T22:50:05.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, facebook
ReporterMatt Schmulen
AssigneeIngo Muschenetz
Created2011-04-15T03:28:04.000+0000
Updated2017-06-07T22:50:05.000+0000

Description

Android facebbook query fails after login event is fired.

If the device has an active facebook session ( after first login )

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

function query_all_friends()
{

Ti.API.info('Query all friends of '+Titanium.Facebook.userId);
var query = "SELECT uid,name,pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = " + Titanium.Facebook.userId + ")";

Titanium.Facebook.query(query, function(r)
{
    Ti.API.info('Query recieved for '+Titanium.Facebook.userId);

    var c = 0;
    var data = [];

    for (c=0;c<r.data.length;c++)
    {
        var row = r.data[c];
        data.push({className:'friends', title:row.name, chosen_name:row.name, leftImage:row.pic_square, uid:row.uid, chosen_pic:row.pic_square, selectedColor:'#ff6600'});          
    }//end if iphone

    var tableview = Titanium.UI.createTableView({ data:data, top: '60', height: 286, filterAttribute:'chosen_name' });          
    tableview.addEventListener('click', function(e) { Ti.API.info('rowClicked: ' + e.row.chosen_name ); });     
    win.add(tableview);
});

}//end query_all_friends

Ti.Facebook.addEventListener('login', function(e)
{

query_all_friends();

});//end

Comments

  1. Lee Morris 2017-06-07

    Closing ticket due to time passed.

JSON Source