0

I'm building a library that is using Firebase database. when i'm taking the exported .aar and importing it via another app - i get the following error:

FirebaseAuthException: This operation is not allowed

the original app didnt allow the firebase database option - so we get this message. problem is I don't need to use the app's Firebase database within the sdk - what I want is the lib's (aar) firebase database to modify.

maybe if there was a way to define two google-services.json files, one for the aar and one for the app - without them overriding themselves?

how can an autonomous firebase database within a library?

KENdi
  • 7,576
  • 2
  • 16
  • 31
Wops
  • 983
  • 9
  • 23

1 Answers1

1

You basically need to have an instance of FirebaseApp created from your library credentials. See this blog, it might help.

Instead of creating and managing 2 different google.json files (I'm not sure whether it's possible or not but even if it is..), i think it's better to wrap your library's firebase database instance and expose a neat api for the consumer apps to interact with your library's database.

Amit Barjatya
  • 249
  • 3
  • 14