authenticateFacebookInstantGame method

  1. @override
Future<Session> authenticateFacebookInstantGame({
  1. required String signedPlayerInfo,
  2. bool create = true,
  3. String? username,
  4. Map<String, String>? vars,
})
override

Implementation

@override
Future<model.Session> authenticateFacebookInstantGame({
  required String signedPlayerInfo,
  bool create = true,
  String? username,
  Map<String, String>? vars,
}) async {
  final request = api.AuthenticateFacebookInstantGameRequest()
    ..create_2 = api.BoolValue(value: create)
    ..account = (api.AccountFacebookInstantGame()
      ..signedPlayerInfo = signedPlayerInfo
      ..vars.addAll(vars ?? {}));

  if (username != null) {
    request.username = username;
  }

  final res = await _client.authenticateFacebookInstantGame(request);

  return model.Session.fromDto(res);
}