Skip to content

bug: Android getDeliveredNotifications are missing the data part #763

@khamaileon

Description

@khamaileon

Plugin(s)

  • Analytics
  • App
  • App Check
  • Authentication
  • Crashlytics
  • Cloud Firestore
  • Cloud Functions
  • Cloud Messaging
  • Cloud Storage
  • Performance
  • Remote Config

Version

6.2.0

Platform(s)

  • Android
  • iOS
  • Web

Current behavior

I send notifications to iOS and Android, always including data (in this specific case: path and trip_id). When I call getDeliveredNotifications, I receive these two pieces of info in the iOS response, but not in the Android response.

iOS:

[
  {
    "id": "765AD00C-A290-4BEA-A217-3B6E6F37AFD3",
    "title": "Paul Smith",
    "subtitle": "",
    "data": {
      "fcm_options": { "image": "https://domain.app/images/icon.svg" },
      "aps": {
        "alert": { "body": "b", "title": "Paul Smith" },
        "mutable-content": 1
      },
      "google.c.fid": "cE5UuzmK1k52uIElXi9HL3",
      "google.c.a.e": "1",
      "google.c.sender.id": "272527473304",
      "path": "/Awe0EyW/messages/dc480249-38e9-47c2-9f8c-2b5205311263",
      "gcm.message_id": "1732535077617442",
      "trip_id": "Awe0EyW"
    },
    "body": "b"
  },
  {
    "id": "D6C4D5CB-1D22-4976-B8BA-C18E06AA2DD4",
    "title": "Paul Smith",
    "subtitle": "",
    "data": {
      "fcm_options": { "image": "https://domain.app/images/icon.svg" },
      "google.c.fid": "cE5UuzmK1k52uIElXi9HL3",
      "aps": {
        "alert": { "body": "a", "title": "Paul Smith" },
        "mutable-content": 1
      },
      "google.c.a.e": "1",
      "gcm.message_id": "1732535076483747",
      "google.c.sender.id": "272527473304",
      "path": "/Awe0EyW/messages/d6fb828f-ea82-4fe5-8ce0-953363006452",
      "trip_id": "Awe0EyW"
    },
    "body": "a"
  }
]

Android:

[
  {
    "id": "2147483647",
    "tag": "ranker_group",
    "data": {
      "android.reduced.images": true,
      "android.appInfo": "ApplicationInfo{b50504a app.domain}"
    }
  },
  {
    "id": "0",
    "tag": "FCM-Notification:3557634",
    "title": "Paul Smith",
    "body": "a",
    "data": {
      "android.title": "Paul Smith",
      "android.reduced.images": true,
      "android.template": "android.app.Notification$BigTextStyle",
      "android.showChronometer": false,
      "android.text": "a",
      "android.progress": 0,
      "androidx.core.app.extra.COMPAT_TEMPLATE": "androidx.core.app.NotificationCompat$BigTextStyle",
      "android.progressMax": 0,
      "android.appInfo": "ApplicationInfo{ce4ebbb app.domain}",
      "android.showWhen": true,
      "android.bigText": "a",
      "android.progressIndeterminate": false
    }
  },
  {
    "id": "0",
    "tag": "FCM-Notification:3558672",
    "title": "Paul Smith",
    "body": "c",
    "data": {
      "android.title": "Paul Smith",
      "android.reduced.images": true,
      "android.template": "android.app.Notification$BigTextStyle",
      "android.showChronometer": false,
      "android.text": "c",
      "android.progress": 0,
      "androidx.core.app.extra.COMPAT_TEMPLATE": "androidx.core.app.NotificationCompat$BigTextStyle",
      "android.progressMax": 0,
      "android.appInfo": "ApplicationInfo{aed88d8 app.domain}",
      "android.showWhen": true,
      "android.bigText": "c",
      "android.progressIndeterminate": false
    }
  },
  {
    "id": "0",
    "tag": "FCM-Notification:3558114",
    "title": "Paul Smith",
    "body": "b",
    "data": {
      "android.title": "Paul Smith",
      "android.reduced.images": true,
      "android.template": "android.app.Notification$BigTextStyle",
      "android.showChronometer": false,
      "android.text": "b",
      "android.progress": 0,
      "androidx.core.app.extra.COMPAT_TEMPLATE": "androidx.core.app.NotificationCompat$BigTextStyle",
      "android.progressMax": 0,
      "android.appInfo": "ApplicationInfo{5e54431 app.domain}",
      "android.showWhen": true,
      "android.bigText": "b",
      "android.progressIndeterminate": false
    }
  }
]

Expected behavior

Data should be in the Android response too.

Reproduction

https://github.com/capawesome-team/.capacitor-app

Steps to reproduce

Sorry, it's complicated to reproduce a complete test environment with a notification send.

Other information

No response

Capacitor doctor

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 6.2.0
@capacitor/core: 6.2.0
@capacitor/android: 6.2.0
@capacitor/ios: 6.2.0

Installed Dependencies:

@capacitor/cli: 6.2.0
@capacitor/core: 6.2.0
@capacitor/android: 6.2.0
@capacitor/ios: 6.2.0

[success] iOS looking great! 👌
[success] Android looking great! 👌

Before submitting

  • I have read and followed the bug report guidelines.
  • I have attached links to possibly related issues and discussions.
  • I understand that incomplete issues (e.g. without reproduction) are closed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions