Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User id shown in push notifications instead of user name for mentions #1798

Open
1 task done
Davies-Owen opened this issue Dec 3, 2023 · 2 comments
Open
1 task done
Labels
bug Something isn't working Stale

Comments

@Davies-Owen
Copy link

Davies-Owen commented Dec 3, 2023

Which packages are you using?

stream_chat_flutter, stream_chat_flutter_core

On what platforms did you experience the issue?

iOS

What version are you using?

stream_chat_flutter: 6.12.0
stream_chat_flutter_core: 6.11.0

What happened?

When a user is mentioned in a channel, the push notification received contains their user id instead of their username.
E.g. When the message Hello @John Smith is sent in the channel, the push notification body appears as Hello @1f589ed4-9148-11ee-82ff-f388544c506e

IMG_83827C6C3FB0-1

I would expect there to be a way to replace the ids of mentioned users with their usernames, similar to replaceMentions for Message. What I want is for the push notification body to say Hello @John Smith.

I found this comment from July 2022 saying that this is most likely a backend issue, but I couldn't find a place to file a ticket for the backend.

Steps to reproduce

I'm using Firebase to deliver push notifications.

1. Create a multi-user channel and subscribe two users to it. One of the two users should be subscribed from a phone with push notifications enabled.
2. From one of the user accounts, send a message with a mention, e.g. "Hello @John Smith"
3. The push notification received contains the user's id instead of the user's name

Supporting info to reproduce

No response

Relevant log output

No response

Flutter analyze output

Analyzing project...
No issues found! (ran in 2.6s)

Flutter doctor output

[✓] Flutter (Channel stable, 3.16.0, on macOS 13.5.2 22G91 darwin-arm64, locale en-US)
    • Flutter version 3.16.0 on channel stable at /Users/owen/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision db7ef5bf9f (3 weeks ago), 2023-11-15 11:25:44 -0800
    • Engine revision 74d16627b9
    • Dart version 3.2.0
    • DevTools version 2.28.2

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/owen/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.14.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.84.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.78.0

[✓] Connected device (4 available)
    • Owen’s iPhone (mobile) • 66cdcbbfab6a8d0c8ddccb5490e2b1c7f6a469f1 • ios            • iOS 16.7.2 20H115
    • iPhone 15 Pro (mobile) • D35D56C6-DD9D-4AFB-B016-E9031D4ECF1F     • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • macOS (desktop)        • macos                                    • darwin-arm64   • macOS 13.5.2 22G91
      darwin-arm64
    • Chrome (web)           • chrome                                   • web-javascript • Google Chrome 119.0.6045.199

[✓] Network resources
    • All expected network resources are available.



The missing Android dependencies should not be relevant, since I'm developing and testing for iOS.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Davies-Owen Davies-Owen added the bug Something isn't working label Dec 3, 2023
@pixnbit
Copy link

pixnbit commented Dec 7, 2023

We found out about this issue too during testing. The documentation did mention customizing the push template:

{
  "aps": {
    "alert": {
      "title": "New message from {{ sender.name }}",
      "body": "{{ truncate message.text 2000 }}"
    },
    "mutable-content": 1,
    "category": "stream.chat"
  },
  "stream": {
    "sender": "stream.chat",
      "type": "message.new",
      "version": "v2",
      "id": "{{ message.id }}",
      "cid": "{{ channel.cid }}"
  }
}

But it's doesn't change the mentioning id behavior. Can this ticket be escalated/forwarded to the backend team?

Copy link

This issue is stale because it has been open for 20 days with no activity.

@github-actions github-actions bot added the Stale label Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

2 participants