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 res = await _api.nakamaAuthenticateGameCenter(
body: ApiAccountGameCenter(
playerId: playerId,
bundleId: bundleId,
timestampSeconds: timestampSeconds.toString(),
salt: salt,
signature: signature,
publicKeyUrl: publicKeyUrl,
vars: vars,
),
create: create,
username: username,
);
if (res.body == null) {
throw Exception('Authentication failed.');
}
final data = res.body!;
return model.Session(
created: data.created ?? false,
token: data.token!,
refreshToken: data.refreshToken,
);
}