New users and new interactions

Wednesday, May 14, 2008 at 11:42 AM



We recently enabled OpenSocial apps for new set of users across the globe, increasing traffic by another 10%. Not only does this increase the number of users with access to your apps, it opens up new possibilities for apps with localized features and content. Keep in mind that we expect traffic to increase 5-10 times the current load once we've launched to all users, so start planning to scale now.

Today we enabled opensocial.requestSendMessage on the sandbox, creating a new way for your apps to let users communicate. The messages created with this method will be delivered as email or as orkut messages depending on the user's settings.

Here's some sample code to get you started:

function sendEmail() {
var params = [];
params[opensocial.Message.Field.TITLE]="Hola!";
var body="Como estas?";
var message = opensocial.newMessage(body, params);
var recipient = opensocial.DataRequest.PersonId.OWNER;
opensocial.requestSendMessage(recipient, message);
};
When invoked, the requestSendMessage method will cause orkut to display a dialog with the title, body, and recipient defined in your code, along with a text area where the user can add text themselves and then click a 'send' button. Note that you can also specify a specific user's OpenSocial ID instead of OWNER or VIEWER.

You can also use VIEWER_FRIENDS or OWNER_FRIENDS for the recipients parameter. In this case the user can determine which of the friends should received the message using an auto-complete friend picker form.

Note that on www.orkut.com each user will be able to send up to 10 messages per day. We'll be more lenient in the sandbox so you can test and tweak your messages.

Happy coding!