2

To set Facebook Profile Picture, I know that Facebook PHP SDK has no direct method to do so (see reference answer).

As a workaround, I forward to the user to the Photo URL with &makeprofile=1 parameter, such as:

header('Location: https://www.facebook.com/photo.php?fbid=1015159XXXXXXXX&set=a.YYYYYYYYYYY.ZZZZZZZ.TTTTTTTT&type=1&makeprofile=1');
exit;

This works okay in desktop browser. But in mobile, the feature &makeprofile=1 is ignored, and just redirect to the photo page. User has to manually click "Make Profile Picture" button below the photo. Is there any workaround in mobile browser so that the user does not require to click "Make Profile Picture" button in mobile Facebook view?

Or, is there any Graph API I can use ?

Community
  • 1
  • 1
Raptor
  • 53,206
  • 45
  • 230
  • 366

1 Answers1

2

There's no API support to change user's profile or cover photo till now, but on mobile devices, you need to use the parameter &prof to the end of The photo URL:

I tried m., touch., iphone. sub-domains, all of them works:

https://m.facebook.com/photo.php?fbid=PHOTO_ID&prof 

https://iphone.facebook.com/photo.php?fbid=PHOTO_ID&prof

https://touch.facebook.com/photo.php?fbid=PHOTO_ID&prof
Adam Azad
  • 11,171
  • 5
  • 29
  • 70