Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

ACS Friends Image Not Appearing

$
0
0

I am trying to figure out how I can pull the profile images of a currently logged in user's friends. With the current setup, I am able to pull the first name and last name of the logged in users friends who are using the app, but the picture associated with that friend does not appear. I am not sure if this helps, but I have Social Integrations (facebook) set up as the only way users can register and login with my app and ACS. Below is my code:

var Cloud = require('ti.cloud');
 
data =[];
 
 
var ButtonRetour = Ti.UI.createImageView({
   image:'/images/backButton.png',
   width:50,
   height:36
});             
 
 
ButtonRetour.addEventListener('click', function(){
 
    friends.close();
 
});
 
 
friends.leftNavButton = ButtonRetour;
 
 
var friendsList = Titanium.UI.createTableView({
    height: 366,
    width: 320,
    top: 0,
    left: 0
});
 
friends.add(friendsList);
 
 
Cloud.SocialIntegrations.searchFacebookFriends(function (e){
    if (e.success) {
        alert('Success:\n' +
            'Count: ' + e.users.length);
        for (var i = 0; i < e.users.length; i++) {
            var user = e.users[i];
            alert('id: ' + user.id + '\n' +
                'first name: ' + user.first_name + '\n' +
                'last name: ' + user.last_name);
                var row = Ti.UI.createTableViewRow({
                title:user.first_name
                });
 
                data.push(row);
 
                var lastName = Ti.UI.createLabel({
                text:user.last_name
                });
                row.add(lastName);
 
 
                var profileImage = Ti.UI.createImageView({
                image:user.photo,
                height:50,
                width:50,
                left:5
                });
 
                row.add(profileImage);
 
         }
 
         friendsList.setData(data);
 
    } else {
 
        alert('Error:\n' +
 
            ((e.error && e.message) || JSON.stringify(e)));
 
    }
 
});

Viewing all articles
Browse latest Browse all 8068

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>