1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Flutter Google play services

Discussão em 'Mobile' iniciado por Stack, Outubro 18, 2024 às 01:32.

  1. Stack

    Stack Membro Participativo

    I am creating a flutter game which utilise the Google play games. I use the game_services package.

    When I tried to signIn, the logs says like this:

    code:

    void signin() async {
    try {
    print('account before: $account');
    account = await GamesServices.signIn();
    print('account: $account');
    } catch (e) {
    print('Error on signing: $e');
    }
    }

    @override
    void initState() {
    signin();
    super.initState();
    }


    Logs: I/PlayService( 2169): isAuthenticated: true toString: com.google.android.gms.games.AuthenticationResult@c64b8d0 I/signin ( 2169): success I/flutter ( 2169): account: null

    You can see even after saying success, the account String is empty.

    I had completed these steps

    1. added game_services package
    2. included app_id in AndroidManifest
    3. created OAuth 2.0 Client ID and auth consent screen inside Google cloud project
    4. added xml file inside android/app/src/main/res/values/games-ids.xml

    I want to know why account is null.

    Continue reading...

Compartilhe esta Página