DEV Community

loizenai
loizenai

Posted on

Kotlin Firebase Cloud Messaging – How to Send Upstream Messages | Android

https://grokonez.com/android/kotlin-firebase-cloud-messaging-send-upstream-messages-android

Kotlin Firebase Cloud Messaging – How to Send Upstream Messages | Android

In some Firebase Cloud Messaging tutorials, we have known way to receive Messages. Today we're gonna look at how to send Upstream Messages from an Android Client App.

Related Post: Firebase Cloud Messaging – XMPP Server example to receive Upstream Messages | Spring Integration

I. Way to do

0. Add Firebase to Android App

Follow these steps.

Open Gradle file to check what happens, we can see that some code has been added:

  • build.gradle (project-level):
    
    buildscript {
    // ...
    dependencies {
        // ...
        classpath 'com.google.gms:google-services:3.1.0'
    }
    }
    
  • build.gradle (App-level):
    
    dependencies {
    // ...
    implementation 'com.google.firebase:firebase-messaging:11.0.4'
    }

apply plugin: 'com.google.gms.google-services'

1. Get Sender ID

Go to Settings of your Firebase Project in Firebase Console to get Sender ID.

2. Send an Upstream Message

Using FirebaseMessaging.send() method:

More at:

https://grokonez.com/android/kotlin-firebase-cloud-messaging-send-upstream-messages-android

Kotlin Firebase Cloud Messaging – How to Send Upstream Messages | Androidac

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (0)

Billboard image

📊 A side-by-side product comparison between Sentry and Crashlytics

A free guide pointing out the differences between Sentry and Crashlytics, that’s it. See which is best for your mobile crash reporting needs.

See Comparison

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay