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

Showing facebook profile pic + alloy framework

$
0
0

Hi i am working with the alloy framework and i had a question about facebook requestWithGraph

So on my index.xml there is a FB login button

In my index.js i have the following:

˜˜˜ var facebook = Alloy.Globals.Facebook; facebook.appid = XXXXXXXXXXXXXX; facebook.permissions = ['publish_stream', 'read_stream','user_photos', 'friends_photos', ' user_events', 'friends_events']; facebook.authorize(); $.btnFB.style = facebook.BUTTON_STYLE_WIDE;

facebook.addEventListener('login', function(e) { if(e.success) { var home = Alloy.createController('homescreen').getView();//tussen haakjes naam van bestand home.open();//name of the variable return; } else if(e.error || e.cancelled) { Titanium.UI.createAlertDialog({ title:Error', message:'Error logging in. Please try again' }).show(); return; } }); ˜˜˜

Now i would like to display the profile photo and username of on my profile page of my app. So in my profile.js i have the following code:

˜˜˜ var facebook = Alloy.Globals.Facebook;

facebook.requestWithGraphPath('me?fields=name,picture', {}, 'GET', function(e) { var profilePic = Ti.UI.createImageView({ image:'https://graph.facebook.com/'+Ti.Facebook.uid+'/picture?type=square' }); }); ˜˜˜

Now when i go to my profile page is does not show the profile picture. what am i doing wrong....


Viewing all articles
Browse latest Browse all 8068

Trending Articles



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