Coder Social home page Coder Social logo

make-it-so-android's Issues

The given sign-in provider is disabled for this Firebase project

Hello, I've been following the steps outlined in this codelab (https://firebase.google.com/codelabs/build-android-app-with-firebase-compose). However, upon reaching step 3 and attempting to create an account using my email and password, I encounter an error message stating, "The given sign-in provider is disabled for this Firebase project." I've already added both the email/password and anonymous sign-in providers in the Firebase console. I believe the issue doesn't lie with the google-services.json file since the Anonymous sign-in provider functions correctly (an anonymous user is created every time I uninstall and run the app again). Could you assist me in resolving this problem?

@Preview

Can you make @Preview work for the screens in Android Studio? I can't figure out how to deal with the injected parameters using Preview.

Use Firestore's auto-generated id instead of a random UUID

I've noticed how this app is using UUID.randomUUID().toString() to generate a document ID and save it on Firestore:

Firebase.firestore
.collection(TASK_COLLECTION)
.document(task.id)
.set(task)
.addOnCompleteListener { onResult(it.exception) }

It would be nice to demonstrate Firestore's auto-generated ids instead:

 Firebase.firestore 
     .collection(TASK_COLLECTION) 
     .add(task) 
     .addOnCompleteListener { onResult(it.exception) } 

And when reading the tasks, we'd manually set the id:

value?.documentChanges?.forEach {
    val wasDocumentDeleted = it.type == REMOVED
    val task = it.document.toObject<Task>().apply { task.id = it.document.id  }
    onDocumentEvent(wasDocumentDeleted, task)
}

The EditTask ViewModel is not being initialized correctly.

The way code is written it will reinitialize the viewmodel on each compose (rotate the phone).

LaunchedEffect(Unit) { viewModel.initialize(taskId) }

Instead the ViewModel should have code like this

class EditTaskViewModel @Inject constructor(
  savedStateHandle: SavedStateHandle,
  logService: LogService,
  private val storageService: StorageService,
) : MakeItSoViewModel(logService) {
    val task = mutableStateOf(Task())

    init {
        val taskId = savedStateHandle.get<String>(TASK_ID)
        launchCatching {
            if (taskId != TASK_DEFAULT_ID) {
              task.value = storageService.getTask(taskId.idFromParameter()) ?: Task()
            }
        }
    }

Then remove the taskId parameter on the Screen

fun EditTaskScreen(
  popUpScreen: () -> Unit,
  taskId: String,   ----> remove this
  modifier: Modifier = Modifier,
  viewModel: EditTaskViewModel = hiltViewModel()
) {

Multiple snackbar messages shown

An old Snackbar message gets displayed when launching the app from the recent list

Steps to reproduce

  • Open the app, and do anything to trigger Snackbar message i.e. invalid login
  • Close the app by clicking the back button
  • Reopen the app from the recent app list
  • Snackbar message will be displayed

Create Account doesn't work.

I followed the four steps from the Codelab section (#3 Firebase Authentication) and ran the application in the Simulator.

I tried to create an Account, but when I click the "create account" button, it "clicks" but nothing happens. Firestore Authentication doesn't show a new entry, the create account screen is still visible.

I also tried to use the code from the completed project I downloaded from GitHub. I also compared it to the code I modified from the Codelab - my changes are the same lines found in the completed project.

viewModelScope.launch(showErrorExceptionHandler) what is this?

Could you tell me, please, in simple words, what does the line mean?
viewModelScope.launch(showErrorExceptionHandler)

  1. In which Dispatcher does the coroutine run?
  2. How to run in Dispatchers.IO or do I need to add withContext(Dispatchers.IO) later?

Error linking account

Hi, I'm following this tutorial and when I reach the Firebase Authentication step, I get the following snackbar error while trying to create an account:

The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section [ Please verify the new email before changing email. ]

However, in the Firebase Console I've already added the access provider for email/password (and the anonymous, which is added by default), both have a green tick saying correctly enabled.

I've recreated the Firebase project and the local code, and reproduced the steps (there are very few steps) as straightforward as possible, but I still get this error.

Any ideas of why this could be happening?

Where is TASK_DEFAULT_ID?

In the code I see a reference to TASK_DEFAULT _ID, but there is no such file. Am I missing anything?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.