Update profile picture from an OpenSocial App

Posted on by

This week we released the possibility to change the current VIEWER’s profile picture from within any OpenSocial app through the OpenSocial JavaScript API:

var person = opensocial.newPerson({thumbnailUrl : 'BASE64_ENCODED_PHOTO'});
opensocial.requestUpdateViewer(person, function(response) {
   // response is either true or falseĀ 

When the requestUpdateViewer method is called we will ask the user if he really wants to change his profile picture to the new one. The user’s decision will be passed as a parameter to the callback function. As a developer you have to pass the new picture in the thumbnailUrl field of the opensocial.Person object. The content of this field is just the base64 encoded image in a valid Data-URL format.

For more information seeĀ http://developer.studivz.net/wiki/index.php/Opensocial_(v0.9)#opensocial.requestUpdateViewer

One thought on “Update profile picture from an OpenSocial App

  1. Just wish tto say your articlee is aas surprising.
    The clarity on your publish is simply excellent and i can assume you’re an expert on this
    subject. Fine along with your permission allow me to grasp your RSS feed to keep updated with coming near near post.
    Thanks one million and please carry oon the rewarding

Leave a Reply

Your email address will not be published. Required fields are marked *