Get facebook event description

You must Login before you can answer or comment on any questions.

Hi.

I am struggling with getting the description from my facebook events.

I must have missed something but i cant imagine what it is.....

I can get everything else from my api call so i really dont get it...

i have the access tokens and are logged in etc..

this is my code,

var url = "https://graph.facebook.com/" + Titanium.App.Properties.getString("pagename") + "/events?access_token="+Titanium.Facebook.getAccessToken();
var table = Ti.UI.createTableView({
           top: 10,
           bottom: 10,
            backgroundColor: 'transparent',
                style           : Titanium.UI.iPhone.TableViewStyle.GROUPED,
            separatorColor:'transparent',
        });
var tableData = [];
var json, data, name, picture, description;
 
var xhr = Ti.Network.createHTTPClient({
    onload: function() {
    // Ti.API.debug(this.responseText);
 
    json = JSON.parse(this.responseText);
    for (i = 0; i < json.data.length; i++) {
        data = json.data[i];
        row = Ti.UI.createTableViewRow({
            height:'80dp',
              backgroundImage   : 'images/tablebg.png',
            backgroundColor: 'transparent',
            separatorColor:'transparent',
        });
      var  name = Ti.UI.createLabel({
            text: data.name,
            font:{
                fontSize:'17dp',
            fontWeight:'bold'
        },
        height:'18',
        left:'90dp',
        top:'9dp',
        color:'#eee',
        touchEnabled:true
        });
        row.add(name);
 
        var  desc = Ti.UI.createLabel({
            text: data.description,
            font:{
                fontSize:'13dp'
        },
        height:'14dp',
        left:'90dp',
        top:'29dp',
        color:'#eee',
        shadowColor: '#111',
        shadowOffset:{x:0,y:1},
        touchEnabled:true
        });
        row.add(desc);
 
 
 
 
 
         // Avatar
                var img = Ti.UI.createImageView({
                    image   : 'https://graph.facebook.com/'+ data.id + '/picture',
                    preventDefaultImage : true,
                    width   : 45,
                    height  : 45,
                    top     : 10,
 
                    borderRadius : 7,
                    borderColor : 'transparent',
                    left    : 20
                });
                row.add(img);
 
        row.message = data.location;
        row.name = data.name;
        row.id = data.id;
        row.pic = data.picture;
        row.start = data.start_time;
        row.end = data.end_time;
        row.desc = data.description;
        tableData.push(row);
        }
 
    table.setData(tableData);
    },
    onerror: function(e) {
    Ti.API.debug("STATUS: " + this.status);
    Ti.API.debug("TEXT:   " + this.responseText);
    Ti.API.debug("ERROR:  " + e.error);
    Titanium.UI.createAlertDialog({
 title: ' Tranan',
 message: 'U must log in to see this....'
}).show();
    },
    timeout:5000
});
 
xhr.open("GET", url);
xhr.send();
 
win.add(table);
win.open();

Your Answer

Think you can help? Login to answer this question!