5. Invite friends Code example The OpenSocial API call that should be used to share an application is: opensocial.requestShareApp(null, null, null) Default call, without ids to pre-select (it’ll select them all), subtitle, callback opensocial.requestShareApp (recipients, reason, opt_callback, opt_params) There is an "Invite friends" button available in the canvas view . This button will always be available in all applications even if your application does not use opensocial.requestShareApp More information and examples at the CodeRunner exercises - Sharing Applications section http:// www.sonico.com/app_dev_docs.php
6.
7. Activities Code example var params = { 'title' : 'just posted an activity.' }; var activity = opensocial.newActivity(params); opensocial.requestCreateActivity(activity) Post a simple activitie: You can customize your app activitie by adding the body parameter and including the desired HTML code in it. More information and examples at the Documentation and Alignments - Viral Channels section http:// www.sonico.com/app_dev_docs.php
8.
9. Notifications Code example The title parameter must contain a URL to an image, which will be shown on the notifications page. Here you may also use a Sonico userid instead of “VIEWER”. More information and examples at the Documentation and Alignments - Viral Channels section http:// www.sonico.com/app_dev_docs.php var urlToThumbnail = “thumbnail-URL"; var params = { 'title': urlToThumbnail, 'type': opensocial.Message.Type.NOTIFICATION }; var message = opensocial.newMessage("This is a notification", params); opensocial.requestSendMessage("VIEWER", message); Post a simple activitie:
10.
11. E-Mail messages Code example Here you may also use a Sonico userid instead of “VIEWER”. More information and examples at the Documentation and Alignments - Viral Channels section http:// www.sonico.com/app_dev_docs.php Send an e-mail to the viewer: var params = { 'title': "this is the title", 'type': opensocial.Message.Type.EMAIL }; var message = opensocial.newMessage("This is the email message", params); opensocial.requestSendMessage("VIEWER", message);
12.
13. Raul Bajales OpenSocial Technical Leader [email_address] Alejandro Sena Product Architect [email_address] Thanks! Feel free to contact us if you have any question.