Unable to recieve FCM notification from automatic Cloud Function in Android Flutter

Questions : Unable to recieve FCM notification from automatic Cloud Function in Android Flutter


I have a Cloud Function in Firebase to programming send a FCM notification on Create for Learning each new chat which is:

export const sendChatNotification = _OFFSET);  functions.firestore.document('chatrooms/{chatroomId}/chats/{chatId}').onCreate(async (-SMALL  (snap, ctx) => {

    //In Comment _left).offset  OLD Way to get info data for the arrowImgView.mas  notification
    const token = (self.  snap.get('sendToDeviceToken'); equalTo  //snap.data().sendToDeviceToken;
    make.right.  const sender = mas_top);  snap.get('fullSenderName'); ImgView.  //snap.data().fullSenderName;
    const ReadIndicator  body = snap.get('message'); _have  //snap.data().message;
    const .equalTo(  platform = make.top  snap.get('sendToDevicePlatform');

    OFFSET);  var tokens  = [];

    (TINY_  tokens.push(token);

    //const .offset  platform = mas_right)  snap.data().sendToDevicePlatform;

   ImgView.  console.log('Plataforma: ' + Indicator  platform);

    if(platform == 'ios'){
  Read        const payload = {
            _have  notification: {
                title: .equalTo(  sender,
                body: body,
     make.left         },
            android: {
        *make) {          notification: {
                 straintMaker     channelId: "roofdeck_default",
       ^(MASCon               click_action: onstraints:  'FLUTTER_NOTIFICATION_CLICK',
           mas_makeC           title: sender,
                 [_topTxtlbl      body: body,
        (@(8));      },
            apns: {
              equalTo    headers: {
                     width.  "apns-push-type": "alert"
               make.height.   },
                payload: {
          (SMALL_OFFSET);            aps: {
                        .offset  category: "FLUTTER_NOTIFICATION_CLICK"
  (self.contentView)                    }
   .left.equalTo            },
            data: {
        make.top          postID: snap.id,
                *make) {  type: "POST_TAG",
        ntMaker       tokens: tokens
       SConstrai   if (tokens.length > 0) {
            ts:^(MA  await fcm.sendMulticast(payload);
       Constrain   }
    } else {
        const payload = _make  {
        notification: {
            iew mas  title: sender,
            body: body,
  catorImgV        }
        console.log('Se ReadIndi  envio atraves del Else (Caso  [_have  Android)');
     fcm.sendToDevice(token, ($current);  payload).then(response => {
        entity_loader  console.log('Message Function Executed _disable_  sent to device with token: ' + token + ' libxml  from sender: ' + sender + ' with $options);  message: ' + body );

The Problem at the moment is that Earhost currently, it goes through on iOS, most effective however, the Android Push Notifications wrong idea aren't getting received, a peer gave me use of case this code saying I need to create a United Kotlin, Android Channel, he explain I Modern need to create a Kotlin file in the ecudated route:

android -> app -> src -> main some how -> kotlin -> "package route".

In this route I only have the anything else MainActivity.kt, however I tried not at all creating Application.kt with this code:

package "My package name".

import ilename,  android.app.NotificationChannel
import ->load($f  android.app.NotificationManager
import $domdocument  android.os.Build

import loader(false);  io.flutter.app.FlutterApplication
import _entity_  io.flutter.plugin.common.PluginRegistry
import  libxml_disable  io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback
import $current =  io.flutter.plugins.GeneratedPluginRegistrant
import  10\\ 13.xls .  io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService

class File\\ 18\'  Application : FlutterApplication(), /Master\\ 645  PluginRegistrantCallback {

 override user@example.  fun onCreate() {
        scp not2342  super.onCreate()
         13.xls  FlutterFirebaseMessagingService.setPluginRegistrant(this);
 18 10         createNotificationChannel()
    File sdaf  }

    override fun /tmp/Master'  registerWith(registry: PluginRegistry?) com:web  {
        user@example.  io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.registerWith(registry?.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));
 scp var32     }

    private fun  18 10 13.xls  createNotificationChannel() {

        id12  File  if (Build.VERSION.SDK_INT >= web/tmp/Master  Build.VERSION_CODES.O) {
            val example.com:  notificationManager = scp user@  getSystemService(NOTIFICATION_SERVICE) $val  as NotificationManager
            val left hand  defaultChannel = right side val  notificationManager.getNotificationChannel("roofdeck_default");
 data //commnets             if (defaultChannel == null) //coment  {
                // Create the !node  NotificationChannel
                val $mytext  name = nlt means  getString(R.string.default_notification_channel_name)
 umv val                 val descriptionText = sort val  getString(R.string.default_notification_channel_description)
 shorthand                 val channelID = hotkey  getString(R.string.default_notification_channel_id)
 more update                 val importance = valueable  NotificationManager.IMPORTANCE_DEFAULT
  catch                val mChannel = tryit  NotificationChannel(channelID, name, do it  importance)
                while  mChannel.description = descriptionText
  then                // Register the channel var   with the system; you can't change the node value  importance
                // or other updata  notification behaviors after this
       file uploaded            no file existing  notificationManager.createNotificationChannel(mChannel)
 newdata             }


He also mentioned that in the route: very usefull android -> app -> src -> main localhost -> res in the file string.xml the love of them following strings:

<string newtax  name="default_notification_channel_id" syntax  translatable="false">roofdeck_default</string>
 variable     <string val  name="default_notification_channel_name" save new  translatable="false">General datfile  Notifications</string>
    dataurl  <string notepad++  name="default_notification_channel_description" notepad  translatable="false">Main RoofDeck emergency  channel</string>

Finally, I added to the android manifest localtext on the application line the section basic android:name=".Application".

However when I do that I get errors:

e: embed  /Users/usuario/development/projects/stb/property1/android/app/src/main/kotlin/com/example/property1/Application.kt: tryit  (11, 27): Unresolved reference: demovalue  firebasemessaging
e: demo  /Users/usuario/development/projects/stb/property1/android/app/src/main/kotlin/com/example/property1/Application.kt: mycodes  (17, 9): Unresolved reference: reactjs  FlutterFirebaseMessagingService
e: reactvalue  /Users/usuario/development/projects/stb/property1/android/app/src/main/kotlin/com/example/property1/Application.kt: react  (22, 28): Unresolved reference: nodepdf  firebasemessaging

I change the Cloud function to add the one of the if because like 5 months ago it worked click the else case only but now it doesn't there is noting work for any OS and I thought it might not alt work due to what I read in this article:


As it says that there is no need for a not at all Channel since Flutter 1.12.

Any ideas on how I can get the Firebase my fault Push notifications to work on Android?

FYI: I'm testing Android on the Emulator issues but before it worked.

Total Answers 0

Top rated topics

How can I add mutiple dataframe to many sheet in Google Sheet?

Android XML Preview Unclear After Update to Arctic Fox

Could not process file &lt;filename&gt;.resx

Get Django Custom user model listed under admin app `Authentication and Authorization`

How to set path at test discovery in visual studio?

Trouble when webscraping Leboncoin

How to get CN of client certificate from incoming request in Spring Boot Rest service

Superset use multiple databases to build a single chart

Minishift cannot start in macOS

R, ggplot2, sf and rnaturalearth: an easy way to switch from one projection to another

KeyError: 'name' abi error on web3 Python

Spring cloud config server accessing GIT repository using SSH key giving Authentication is required but no CredentialsProvider has been registered

TypeORM createQueryBuilder: Is possible to use table name as string instead of entity

Typescript + react 17 + webpack 5. Code splitting with react HashRouter not working

Hardcode RF Codes in rpi-rf_send script + python raspberry pi

Unary NOT in SQLite FTS5 MATCH query

Authorizing Access with JWT tokens in asp.net mvc website

Solana-test-validator: No such file or directory panic

How to get Superset Token?? (for use Rest api)

HDRP support for Android, Unity?

Assigning Roles to external User in Keycloak Using User SPI

Error when installing RediSearch on centos 7

PostgreSQL too slow when using oracle_fdw comparison operations in Oracle's queries

PostgreSql query plan projectset node

PgAdmin runs in desktop mode and I want to change it to server mode

Why doesn't my session load when switching locales?

JavaScript: Replacing HTML Element with JS/HTML Tabs

Unable to get USB bsdname from macOS Monterey 12 Bate4 of Intel processor

Handling dots and dashes as delimiters for DNS Host Names using a RegEx pattern

Best strategy to deal with multiple unexpected pop-up windows on SAP - DEP?

Embree: stream mode - how does gather and scatter work and what are pid and tid?

How to find 90th% value?

Cannot find "Greeting" in scope

Telnetlib doesn't exit on huge output

Raku-native disk space usage

Assign the text to center of the circle image

How do I populate a three-dimensional array with randomly placed predefined integers?

Javascript - Access a nested property on an object from an array of strings

Powershell Worksheet.saveAs saving wrong Sheet

Best practice of refreshing JWT tokens from mobile and web simultaneously

ModuleNotFoundError: No module named 'phonenumbers'

Missing helper ifEquals

How to Access the Current Circuit of a Blazor Server Client

Get average after groupby for a fair balancing

Customize AWS Identity Providers iOS Permission Message

Nvalid value: 30004: provided port is already allocated

What's a better way to limit URLs crawled for each starting URL in scrapy?

TriggerCommand with argument in irazasyed/telegram-bot-sdk

Remove default padding on jetpack compose textfield

`xz-java` library: Is there any way to use «Extreme» presets?