Embedded Experience In OpenSocial Messages
Proposal
Embedded experiences was introduced as part of OpenSocial 2.0 with the two main use cases being email and activity streams. Â A natural addition to objects that can contain embedded experience is the OpenSocial Message object. Â The use case here being a gadget or user sends a message to another user containing an embedded experience. Â
Use Case
Say you have a photo sharing gadget which allows a user to share photos, or photo albums with other users in the network. Â User A uploads a photo using the gadget and then selects to share the photo with all of his friends. Â The photo sharing gadget chooses to send a message to each of User A's friends including an embedded experience allowing the recipients to comment on the photo.
Updates To The Message Data Model
Here is the existing message data model.
The easiest way to add embedded experiences to the message object would be to add an embed field to data model. Â This field would contain the embedded experiences data model.
The other option would be to leverage the data field (not currently listed in the fields table Issue 1262) to include the embedded experiences data model. Â However the spec defines how to use the data field as...
This seems to indicate that the data field should be used for information specific tot he gadget sending or displaying the message. Â However the embedded experience may not necessarily be specific to either gadget.The 'data' field is used for information specific to the gadget that is sending or displaying the message. It may be omitted in most messages. An example is a message from a user asking to join a group. In the received message to the group's owner(s), the 'data' field could contain the JSON or XML representation of an OpenSocial Group.