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...
Summary: Constants | Inherited Constants | Methods | Inherited Methods | [Expand All]
public interface

# Invitation

implements Parcelable Freezable<T> Participatable

com.google.android.gms.games.multiplayer.Invitation

Known Indirect Subclasses
InvitationEntity

InvitationEntity | Data object representing the data for a multiplayer invitation.

## Class Overview

Data interface for an invitation object.

## Summary

Constants
int | INVITATION_TYPE_REAL_TIME | Constant indicating that this invitation is for a real-time room.
int | INVITATION_TYPE_TURN_BASED | Constant indicating that this invitation is for a turn-based match.

[Expand] Inherited Constants

From interface android.os.Parcelable

int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |

Public Methods
abstract int | getAvailableAutoMatchSlots() Return the maximum number of available automatch slots for this invitation.
abstract long | getCreationTimestamp() Retrieve the server timestamp at which this `Invitation` was created.
abstract Game | getGame() Retrieve the `Game` object that this `Invitation` is associated with.
abstract String | getInvitationId() Retrieve the ID of this `Invitation`.
abstract int | getInvitationType() Retrieve the type of this `Invitation`.
abstract Participant | getInviter() Retrieve the `Participant` who created this `Invitation`.
abstract int | getVariant() Retrieve the variant specified for this `Invitation`, if any.

[Expand] Inherited Methods

From interface android.os.Parcelable

abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)

From interface com.google.android.gms.common.data.Freezable

abstract T | freeze() Freeze a volatile representation into an immutable representation.
abstract boolean | isDataValid() Check to see if this object is valid for use.

From interface com.google.android.gms.games.multiplayer.Participatable

abstract ArrayList<Participant> | getParticipants() Retrieve the `Participant`s for this object.

## Constants

#### public static final int INVITATION_TYPE_REAL_TIME

Constant indicating that this invitation is for a real-time room.

Constant Value: 0 (0x00000000)

#### public static final int INVITATION_TYPE_TURN_BASED

Constant indicating that this invitation is for a turn-based match.

Constant Value: 1 (0x00000001)

## Public Methods

#### public abstract int getAvailableAutoMatchSlots ()

Return the maximum number of available automatch slots for this invitation. If automatch criteria were not specified during creation, or if all slots have been filled, this will return 0.

##### Returns

- The maximum number of additional players that can be added to this game.

#### public abstract long getCreationTimestamp ()

Retrieve the server timestamp at which this `Invitation` was created.

##### Returns

- The server timestamp at which this `Invitation` was created.

#### public abstract Game getGame ()

Retrieve the `Game` object that this `Invitation` is associated with.

##### Returns

- `Game` object for this `Invitation`.

#### public abstract String getInvitationId ()

Retrieve the ID of this `Invitation`.

##### Returns

- The ID of this `Invitation`.

#### public abstract int getInvitationType ()

Retrieve the type of this `Invitation`. May be either `INVITATION_TYPE_REAL_TIME` or `INVITATION_TYPE_TURN_BASED`.

##### Returns

- The type of the `Invitation`.

#### public abstract Participant getInviter ()

Retrieve the `Participant` who created this `Invitation`.

##### Returns

- The `Participant` who created this `Invitation`.

#### public abstract int getVariant ()

Retrieve the variant specified for this `Invitation`, if any. A variant is an optional developer-controlled parameter describing the type of game to play. If specified, this value will be a positive integer. If this invitation had no variant specified, returns `ROOM_VARIANT_ANY` or `MATCH_VARIANT_ANY`.

##### Returns

- Variant specified for this invitation, if any.