Except as otherwise noted,
the content of this page is licensed under the Creative Commons
Attribution 2.5 License.
Namespace for top-level people functions.
<static>
opensocial.Environment
getEnvironment()
<static>
Boolean
hasPermission(permission)
<static>
makeRequest(url, callback, opt_params)
<static>
opensocial.Activity
newActivity(title, opt_params)
<static>
opensocial.Activity.MediaItem
newActivityMediaItem(mimetype, url, opt_params)
<static>
opensocial.DataRequest
newDataRequest()
<static>
requestCreateActivity(activity, priority, opt_callback)
<static>
requestNavigateTo(surface, opt_params)
<static>
requestPermission(permissions, reason, opt_callback)
<static> opensocial.Environment getEnvironment()
opensocial.Environment The current environment
<static> Boolean hasPermission(permission)
opensocial.Permission permission - The permission
Boolean True if the gadget has access for the permission; false if it doesn't
<static> makeRequest(url, callback, opt_params)
String url - The URL where the content is located
Function callback - The function to call with the data from the URL
once it is fetched
Map.<opensocial.ContentRequestParameters, Object> opt_params - Additional parameters to pass to the request
<static> opensocial.Activity newActivity(title, opt_params)
See also: requestCreateActivity(),
String title - The title of an activity
Map.<opensocial.Activity.Field, Object> opt_params - Any other
fields that should be set on the activity object; all of the defined
Fields are supported
opensocial.Activity The new
activity object
<static> opensocial.Activity.MediaItem newActivityMediaItem(mimetype, url, opt_params)
MediaItem.Type mimetype - MIME type of the
media
String url - Where the media can be found
Map.<opensocial.Activity.MediaItem.Field, Object> opt_params - Any other fields that should be set on the media item object;
all of the defined
Fields
are supported
opensocial.Activity.MediaItem The new
media item object
<static> opensocial.DataRequest newDataRequest()
opensocial.DataRequest The
request object
<static> requestCreateActivity(activity, priority, opt_callback)
See also: newActivity()
Note: If this is the first activity that has been created for the user and the request is marked as HIGH priority then this call may open a user flow and navigate away from your gadget.
Activity activity - The
activity to create
CreateActivityPriority priority - The
priority for this
request
Function opt_callback - The function to call once the request has been
processed. This callback will either be called or the gadget will be
reloaded from scratch
<static> requestNavigateTo(surface, opt_params)
opensocial.Surface surface - The surface to navigate to
Map.<String, String> opt_params - Params to pass to the gadget after it
has been navigated to on the surface
<static> requestPermission(permissions, reason, opt_callback)
Array.<opensocial.Permission> permissions - The permissions to request
from the viewer
String reason - Displayed to the user as the reason why these
permissions are needed
Function opt_callback - The function to call once the request has been
processed; either this callback will be called or the gadget will be
reloaded from scratch