authenticateGameCenter method
Future<Session>
authenticateGameCenter({
- required String playerId,
- required String bundleId,
- required int timestampSeconds,
- required String salt,
- required String signature,
- required String publicKeyUrl,
- bool create = true,
- String? username,
- Map<
String, String> ? vars,
override
Implementation
@override
Future<model.Session> authenticateGameCenter({
required String playerId,
required String bundleId,
required int timestampSeconds,
required String salt,
required String signature,
required String publicKeyUrl,
bool create = true,
String? username,
Map<String, String>? vars,
}) async {
final request = AuthenticateGameCenterRequest()
..create_2 = BoolValue(value: create)
..account = (AccountGameCenter()
..playerId = playerId
..bundleId = bundleId
..timestampSeconds = Int64(timestampSeconds)
..salt = salt
..signature = signature
..publicKeyUrl = publicKeyUrl
..vars.addAll(vars ?? {}));
if (username != null) {
request.username = username;
}
final res = await _client.authenticateGameCenter(request);
return model.Session(
created: res.created,
token: res.token,
refreshToken: res.refreshToken,
);
}