How to implement Firebase and Notifications Push in App

Josue4 years ago

Hi.
I want to implement push notifications with firebase and android. But it doesn't want to work for me.
I already included the google-services.json file, I already changed the settings on the server, I already compiled the app and it doesn't work. What am I doing wrong.

The key that I put in the firebase configuration is the one that gives me the "cloud messaging", called "Server key"

Anton Tananaev4 years ago

Everything seems correct. Are you building the right flavor of the app? Have you checked user attributes to see if you get the token?

Josue4 years ago

Not getting the token, is clear

Josue4 years ago

The build is correct

Anton Tananaev4 years ago

I don't see build flavor on your screenshot. Which flavor are you building?

Josue4 years ago

I don't understand your question very well .. I don't know much English and I don't know the word "flavor"

Anton Tananaev4 years ago

Are you familiar with Android development? It's a standard term.

Josue4 years ago

Yes.


Anton Tananaev4 years ago

Then you should definitely know what "flavor" is.

Josue4 years ago

The flavor not is this

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId 'site.seelight.gps'
        minSdkVersion 19
        targetSdkVersion 29
        versionCode 20
        versionName '2.9'
    }
    flavorDimensions 'default'
    productFlavors {
        regular {
            isDefault.set(true)
        }
        google
    }
    buildToolsVersion = '28.0.3'
}
Anton Tananaev4 years ago

You have to select it in the Android Studio. I would recommend you to read Android Studio documentation if you are not familiar with it.

Josue4 years ago

Someone else who knows much more about this and helps

Josue4 years ago

I could already make it work. I had to change "Build Variants"

Josue4 years ago

Now I have a detail .. You are only sending the "test notifications". It does not send any event notification.

Seelight4 years ago

Pack of images of problem https://imgur.com/a/p1Vt8BF