Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

close

- - Get Started
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
    - Get the SDK
  - Google Services
- - Google Play
  - Publishing
  - Promoting
  - App Quality
  - Spotlight
  - Open Distribution

## Results

Loading...
public interface

# Invitations

com.google.android.gms.games.multiplayer.Invitations

## Class Overview

Entry point for invitations functionality.

## Summary

Nested Classes
interface | Invitations.LoadInvitationsResult | Result delivered when invitations have been loaded.

Public Methods
abstract Intent | getInvitationInboxIntent(GoogleApiClient apiClient) Returns an intent that will let the user see and manage any outstanding invitations.
abstract PendingResult<Invitations.LoadInvitationsResult> | loadInvitations(GoogleApiClient apiClient) Asynchronously load the list of invitations for the current game.
abstract void | registerInvitationListener(GoogleApiClient apiClient, OnInvitationReceivedListener listener) Register a listener to intercept incoming invitations for the currently signed-in user.
abstract void | unregisterInvitationListener(GoogleApiClient apiClient) Unregisters this client's invitation listener, if any.

## Public Methods

#### public abstract Intent getInvitationInboxIntent (GoogleApiClient apiClient)

Returns an intent that will let the user see and manage any outstanding invitations. Note that this must be invoked using `startActivityForResult(Intent, int)` so that the identity of the calling package can be established.

If the user canceled, the result will be `RESULT_CANCELED`. If the user selected an invitation to accept, the result will be `RESULT_OK` and the data intent will contain the selected invitation as a parcelable extra in `EXTRA_INVITATION`.

Required API: `API`
Required Scopes: `SCOPE_GAMES`

##### Parameters

apiClient | The `GoogleApiClient` to service the call.

##### Returns

- An `Intent` that can be started to view the invitation inbox UI.

#### public abstract PendingResult<Invitations.LoadInvitationsResult> loadInvitations (GoogleApiClient apiClient)

Asynchronously load the list of invitations for the current game.

Required API: `API`
Required Scopes: `SCOPE_GAMES`

##### Parameters

apiClient | The `GoogleApiClient` to service the call.

##### Returns

- `PendingResult` to access the data when available.

#### public abstract void registerInvitationListener (GoogleApiClient apiClient, OnInvitationReceivedListener listener)

Register a listener to intercept incoming invitations for the currently signed-in user. If a listener is registered by this method, the incoming invitation will not generate a status bar notification as long as this client remains connected.

Note that only one invitation listener may be active at a time. Calling this method while another invitation listener was previously registered will replace the original listener with the new one.

Required API: `API`
Required Scopes: `SCOPE_GAMES`

##### Parameters

apiClient | The `GoogleApiClient` to service the call.
listener | The listener that is called when a new invitation is received. The listener is called on the main thread.

#### public abstract void unregisterInvitationListener (GoogleApiClient apiClient)

Unregisters this client's invitation listener, if any. Any new invitations will generate status bar notifications as normal.

Required API: `API`
Required Scopes: `SCOPE_GAMES`

##### Parameters

apiClient | The `GoogleApiClient` to service the call.