RequestSendMessage Sample Application

RequestSendMessage Sample Application

RequestSendMessage/RequestShareApp allows deep interactivity with the MySpace system. Toggle the Intro for more information, or just View Source and play around.

Javascript snippets to the right give a clue as to how this works. If you view source on this frame you'll get a deeper clue. Don't be intimidated by the source, tho. Most of it is for the FriendPicker widget.

Toggle Intro

Post Target:
RequestSendMessage/RequestShareApp

var message = opensocial.newMessage(content);
message.setField(opensocial.Message.Field.TITLE, subject);
message.setField(opensocial.Message.Field.TYPE, postType);

var recipientPerson = window.friendPicker.selectedFriend;
var id = recipientPerson.getId();

opensocial.requestSendMessage(id, message, rsmCallback);

To YOUR account



To a friend
(recipient required)



To
MySpace Friend Picker (copy embedded script for now - external lib coming)
window.friendPicker = new MyOpenSpace.Widgets.FriendPicker(
                {
                                element: "pickerDivID",
                                friendClickAction: pickedOne
                });           
Subject
Content