viewmodel-firebase-sample icon indicating copy to clipboard operation
viewmodel-firebase-sample copied to clipboard

Integrate Firestore

Open gonzalonm opened this issue 6 years ago • 8 comments

https://firebase.google.com/docs/firestore/quickstart?hl=es-419

gonzalonm avatar Oct 26 '18 12:10 gonzalonm

Hey Gonzalo I was able to integrate Firestore and Ill be happy to collaborate, just create a new project. Thanks and best regards

johnjake avatar Dec 15 '18 11:12 johnjake

Hey John! Happy to hear that! Are there any ways to integrate Firestore to the current project as "another repository"? If not, we can create a new project without problem. I didn't have much time to review Firestore and how to use that, but I assume this should be very similar to Firebase. If that is the case, I think we can create a new branch to include that.

Regards, Gonzalo.

gonzalonm avatar Dec 19 '18 19:12 gonzalonm

This is how i do it for the sign in and signup auth

` public class BaseAuthOnCompleteListener implements OnCompleteListener<AuthResult> {

private FireAuthCallback fireAuthCallback;
 public BaseAuthOnCompleteListener(FireAuthCallback fireAuthCallback) {
    this.fireAuthCallback = fireAuthCallback;
}
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
    if(task.isSuccessful()){
        fireAuthCallback.onSuccess(task);
    }else if(!task.isSuccessful())
        try{
            throw task.getException();
        }catch (FirebaseAuthWeakPasswordException weakPassword){
           fireAuthCallback.onError(weakPassword);
        }catch (FirebaseAuthInvalidCredentialsException malformedEmail){
            fireAuthCallback.onError(malformedEmail);
        }catch (FirebaseAuthUserCollisionException existEmail){
            fireAuthCallback.onError(existEmail);
        }catch (FirebaseAuthException authException){
            fireAuthCallback.onError(authException);
        } catch (Exception e){
            fireAuthCallback.onError(e);
        }
  }

}`

johnjake avatar Dec 22 '18 00:12 johnjake

Sorry, for the late response. That looks very good! I assume you fought with that and now have some stable version. If you want, you can implement a simple login screen with that logic and submit them to a new branch. When you have that, I can review it and merge if everything looks good.

gonzalonm avatar Mar 18 '19 11:03 gonzalonm

Hi guys! Finally do you have a stable repository with this commented stuff? Thanks and good work with the viewmodel!!

billyjoker avatar Jul 01 '19 13:07 billyjoker

@gonzalonm Sorry for late reply I been so busy ok I will.

johnjake avatar Jul 09 '19 13:07 johnjake

@billyjoker Yes I have a stable version firestore and firebase using @gonzalonm model. I will create a repo just wait for a couple of days.

johnjake avatar Jul 09 '19 13:07 johnjake

That sounds great! Please, create a new branch from master a push a pull request. I will review it asap!!

gonzalonm avatar Jul 09 '19 14:07 gonzalonm