question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expo-notifications cannot be collapsed and null channelId on Android?

See original GitHub issue

🐛 Bug Report

Summary of Issue

Android notifications from expo never collapsed. I also checked the notifications returned from addNotificationReceivedListener and the channelId is always null

Object {
  "content": Object {
    "autoDismiss": true,
    "badge": null,
    "body": "Another device has logged in to your account.",
    "data": Object {
      "action": "signout",
    },
    "sound": "default",
    "sticky": false,
    "subtitle": null,
    "title": "User logged in",
  },
  "identifier": "0:1605529554731302%0ac519e6f9fd7ecd",
  "trigger": Object {
    "channelId": null,
    "remoteMessage": Object {
      "collapseKey": null,
      "data": Object {
        "body": "{\"action\":\"signout\"}",
        "experienceId": "@adhicl/garuda-chat",
        "message": "Another device has logged in to your account.",
        "title": "User logged in",
      },
      "from": "367315174693",
      "messageId": "0:1605529554731302%0ac519e6f9fd7ecd",
      "messageType": null,
      "notification": null,
      "originalPriority": 2,
      "priority": 2,
      "sentTime": 1605529554727,
      "to": null,
      "ttl": 2419200,
    },
    "type": "push",
  },
}

Environment - output of expo diagnostics & the platform(s) you’re targeting

  Expo CLI 3.28.5 environment info:
    System:
      OS: Windows 10 10.0.19041
    Binaries:
      Node: 10.22.0 - C:\Program Files\nodejs\node.EXE
      npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
    SDKs:
      Android SDK:
        API Levels: 23, 25, 26, 27, 28, 29
        Build Tools: 23.0.1, 26.0.2, 27.0.3, 28.0.3, 29.0.2
        System Images: android-29 | Google Play Intel x86 Atom
    IDEs:
      Android Studio: Version  3.5.0.0 AI-191.8026.42.35.5791312
    npmPackages:
      expo: ^39.0.0 => 39.0.4
      react: 16.13.1 => 16.13.1
      react-native: https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz => 0.63.2
      react-native-web: ~0.13.7 => 0.13.18
      react-navigation: ^4.4.3 => 4.4.3
    Expo Workflow: managed

Target: android

Reproducible Demo

Steps to Reproduce

Hi need help, I have already added “collapse” to app.json notification

"notification": {
      "icon": "./assets/icons/Icon-Garuda-Chat-Notification.png",
      "androidMode": "collapse",
      "androidCollapsedTitle": "#{unread_notifications} new messages"
    }

I updated my project from previous expo notifications to expo-notifications, then I test using expo push notification tools and put “messages” to channelId. Screenshot_20201116-194255 But notifications is not collapsed and the channel id is always null

Expected Behavior vs Actual Behavior

notifications is collapsed into one

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

16reactions
hyochancommented, Dec 14, 2020

Thanks for opening up this thread. However, the collapse feature is really really important in the notification, especially in the chat app. Otherwise, clients will be annoyed by lots of banner threads and the app may be deleted. Hope the expo team recognizes this!

0reactions
Stevemoretzcommented, Oct 12, 2021

Me too

Read more comments on GitHub >

github_iconTop Results From Across the Web

Notifications - Expo Documentation
The expo-notifications provides an API to fetch push notification tokens and ... The plugin allows you to configure various properties that cannot be...
Read more >
android - Expo notifications not working when channel id is used
I am using the following code to create two channels for my expo react app, on Android: Notifications ...
Read more >
Expo SDK 39 Push Notifications Not Working-React Native
... Expo notifications not working when channel id is used ... React Native Push Notifications not working in Android but works fine on...
Read more >
@expo/config | Yarn - Package Manager
expo-notifications ... build errors when the source_login_scripts.sh failed to load. ... throwing permission cannot be null or empty error on Android.
Read more >
Adding notifications to your expo app - | Negative Epsilon
Copy the expo token, write something in the title and body fields and fill with default the Android Channel ID. Once you press...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found