Facebook profile photo

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

Hi, i need save facebook profile photo:

Titanium.Facebook.requestWithGraphPath('me/picture', {}, 'GET', function(e) {
if (e.success) {
 
    // e.result include blob of picture
    var f = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'fb.jpg');
    f.write(e.result);
picture exists (f.exists()==true) in the filesystem, but will not be displayed in ImageView in properties url or image, not even View in properties backgroundImage

value:

Titanium.Filesystem.applicationDataDirectory+'fb.jpg'

Please help :(

— asked 2 years ago by Mário Guzi
2 Comments
  • Have you verified that e.result contains the blob? (TI.API.info(JSON.stringify(e.result))) ?

    Try Ti.API.info(f); below the f.write(); and see what it says.

    I have a funny feeling that the file is not being written either the correct data or any data. getFile/write will actually create the file if it does not eist, so f.exits will always be true.

    — commented 2 years ago by Steven Verbeek

  • Hi Steven,

    yes, e.result include source of jpeg image. When using createHTTPClient (http://graph.facebook.com/MY_OR_FRIEND_ID/picture) will be stored properly.

    — commented 2 years ago by Mário Guzi

Your Answer

Think you can help? Login to answer this question!