Closed erperejildo closed 9 months ago
I have submitted a feature request to the flutterfire repo here. I have implemented a method that returns the server_auth_code
, so once they implement the PlayGamesAuthProvider
, this will be simple.
Hop over there and give it an upvote.
The alternative for the time being is to use the REST API to get the UserCredential
and go from there.
NOTE: I have not pushed the code to retrieve the server_auth_code
which would be necessary for using the API as well. If you want to take that approach before waiting for feedback from the flutterfire team, let me know.
I have also submitted a feature request for Game Center authentication via the GameCenterAuthProvider
. That seemingly requires no changes to the games_services plugin.
Thanks @theLee3. However, there is no rush from my side to implement something else in the meantime.
firebase_auth
has added Play Games and Game Center auth in version 4.17.0.
You can build from the above PR to use now. games_services
4.1.0 will release soon with this functionality.
To sign in with Play Games:
final authCode = await GameAuth.getAuthCode(clientID);
if (authCode != null) {
final userCredential = await FirebaseAuth.instance.signInWithCredential(
PlayGamesAuthProvider.credential(serverAuthCode: authCode),
);
}
To sign in with Game Center:
final userCredential = await FirebaseAuth.instance
.signInWithCredential(GameCenterAuthProvider.credential());
Cool. I'll update as soon as it get released. Thanks
Any idea when it will be released?
@erperejildo
Hi 4.0.1 just got released with this change.
Sorry for the delay guys. And thanks for your efforts!
Not sure if this could be achieved by using this package but I don't find any other documentation related to Flutter. I also found a reference to this package here: https://github.com/firebase/flutterfire/issues/5303
In my app I can authenticate using Google but I'd like to avoid this and use the actual GPG user, which is already logged in.
How can I do this?