Skip to content

Adding gcmSenderId in tests setup #143

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
corrado4eyes opened this issue Feb 1, 2021 · 0 comments
Closed

Adding gcmSenderId in tests setup #143

corrado4eyes opened this issue Feb 1, 2021 · 0 comments

Comments

@corrado4eyes
Copy link
Contributor

corrado4eyes commented Feb 1, 2021

Tests for remote-config fail with the following

Firebase Remote Config is missing the required GCMSenderID property from the configured FirebaseApp and will not be able to function properly. Please fix this issue to ensure that Firebase is correctly configured.

Example test:

class FirebaseConfigTest {

    @BeforeTest
    fun initializeFirebase() {
        Firebase
            .takeIf { Firebase.apps(context).isEmpty() }
            ?.initialize(
                context,
                FirebaseOptions(
                    applicationId = "1:846484016111:ios:dd1f6688bad7af768c841a",
                    apiKey = "AIzaSyCK87dcMFhzCz_kJVs2cT2AVlqOTLuyWV0",
                    databaseUrl = "https://fir-kotlin-sdk.firebaseio.com",
                    storageBucket = "fir-kotlin-sdk.appspot.com",
                    projectId = "fir-kotlin-sdk"
                )
            )
    }

    @Test
    fun testFetch() = runTest {
        Firebase.config.fetch()
    }
}

When testFetch() is executed the test fails with the message above. I checked the other tests and it seems that none of them is passing gcmSenderId in FirebaseOptions. Is it possible to add it?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant