PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → Implementing Firebase Real-time Database
Implementing Firebase Real-time Database
Débuté par Aaron Edge, 16 jan. 2018 12:39 - 2 réponses
Posté le 16 janvier 2018 - 12:39
Hi all, I'm attempting to Integrate Firebase into my windev mobile 22 android application. I have already managed to connect my app to firebase, create a user and log in using the email / password authentication flow. However I would like the user to be able to use google sign in as well. Up until this point I have been following the Firebase guide found here: https://firebase.google.com/docs/auth/android/google-signin

using this guide I have managed to start the google signin activity using:

getCurrentActivity().startActivityForResult(signInIntent, RC_SIGN_IN);

My problem is that I can't get the result using their code in windev:

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);

// Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
if (requestCode == RC_SIGN_IN) {
Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
try {
// Google Sign In was successful, authenticate with Firebase
GoogleSignInAccount account = task.getResult(ApiException.class);
firebaseAuthWithGoogle(account);
} catch (ApiException e) {
// Google Sign In failed, update UI appropriately
Log.w(TAG, "Google sign in failed", e);
// ...
}
}
}

My question is how do I get the result from startActivityForResult?
Posté le 03 juin 2018 - 22:11
Aaron where you able to get it working ? i will like to speak to you about this subject. how can i reach you ?
Membre enregistré
794 messages
Popularité : +40 (42 votes)
Posté le 04 juin 2018 - 16:14
Hi. WM22 already has Oauth authentication implemented, which is compatible with Google, Twitter,... Oauth returns a token that is the one you should use when connecting to the servers

Rubén