Hide

Moments

public interface Moments
com.google.android.gms.plus.Moments

Methods and interfaces related to moments in Google+.

Nested Class Summary

interface Moments.LoadMomentsResult Information about the set of moments that was loaded. 

Public Method Summary

abstract PendingResult<Moments.LoadMomentsResult>
load(GoogleApiClient googleApiClient, int maxResults, String pageToken, Uri targetUrl, String type, String userId)
abstract PendingResult<Moments.LoadMomentsResult>
load(GoogleApiClient googleApiClient)
abstract PendingResult<Status>
remove(GoogleApiClient googleApiClient, String momentId)
abstract PendingResult<Status>
write(GoogleApiClient googleApiClient, Moment moment)

Public Methods

public abstract PendingResult<Moments.LoadMomentsResult> load (GoogleApiClient googleApiClient, int maxResults, String pageToken, Uri targetUrl, String type, String userId)

Lists all of the moments for a particular user. For more information, see https://developers.google.com/+/api/latest/moments/list.

Required API: API
Required Scopes: SCOPE_PLUS_LOGIN

Parameters
googleApiClient The GoogleApiClient to service the call.
maxResults The maximum number of moments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.
pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.
targetUrl Only moments containing this targetUrl will be returned.
type Only moments of this type will be returned.
userId The ID of the user to get moments for. The special value "me" can be used to indicate the authenticated user.
Returns
  • the PendingResult for notification and access to the result when it's available.

public abstract PendingResult<Moments.LoadMomentsResult> load (GoogleApiClient googleApiClient)

Lists all of the moments for the currently signed-in user. For more information, see https://developers.google.com/+/api/latest/moments/list.

Required API: API
Required Scopes: SCOPE_PLUS_LOGIN

Parameters
googleApiClient The GoogleApiClient to service the call.
Returns
  • the PendingResult for notification and access to the result when it's available.

public abstract PendingResult<Status> remove (GoogleApiClient googleApiClient, String momentId)

Deletes a moment. For more information, see https://developers.google.com/+/api/latest/moments/remove.

Required API: API
Required Scopes: SCOPE_PLUS_LOGIN

Parameters
googleApiClient The connected GoogleApiClient to service the call.
momentId The ID of the moment to delete.
Returns
  • the PendingResult for notification and access to the result when it's available.

public abstract PendingResult<Status> write (GoogleApiClient googleApiClient, Moment moment)

Writes a moment. For more information, see https://developers.google.com/+/api/latest/moments/insert.

This is a fire-and-forget method that writes the user's moment asynchronously, but reports back immediately. If there is a network error, Google Play services attempts to send the request again when the device comes back online. Requests can fail if there are problems with the account or format of specified in moment. To debug, run adb logcat in a terminal and find errors related to moments in the output.

Required API: API
Required Scopes: SCOPE_PLUS_LOGIN

Parameters
googleApiClient The connected GoogleApiClient to service the call.
moment The moment description.
Returns
  • the PendingResult for notification and access to the result when it's available.