signInWithGameCenter method
- GoogleCloudIdentitytoolkitV1SignInWithGameCenterRequest request, {
- String? $fields,
Signs in or signs up a user with iOS Game Center credentials.
If the sign-in succeeds, a new Identity Platform ID token and refresh
token are issued for the authenticated user. The bundle ID is required in
the request header as x-ios-bundle-identifier
. An
API key is
required in the request in order to identify the Google Cloud project.
Apple has [deprecated the playerID
field](https://developer.apple.com/documentation/gamekit/gkplayer/1521127-playerid/).
The Apple platform Firebase SDK will use gamePlayerID
and teamPlayerID
from version 10.5.0 and onwards. Upgrading to SDK version 10.5.0 or later
updates existing integrations that use playerID
to instead use
gamePlayerID
and teamPlayerID
. When making calls to
signInWithGameCenter
, you must include playerID
along with the new
fields gamePlayerID
and teamPlayerID
to successfully identify all
existing users. Upgrading existing Game Center sign in integrations to SDK
version 10.5.0 or later is irreversible.
request
- The metadata request object.
Request parameters:
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleCloudIdentitytoolkitV1SignInWithGameCenterResponse.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<GoogleCloudIdentitytoolkitV1SignInWithGameCenterResponse>
signInWithGameCenter(
GoogleCloudIdentitytoolkitV1SignInWithGameCenterRequest request, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
const url_ = 'v1/accounts:signInWithGameCenter';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleCloudIdentitytoolkitV1SignInWithGameCenterResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}