How to setup push notification title as Sender name.

46 views
Skip to first unread message

thành phan

unread,
May 3, 2024, 4:30:28 AMMay 3
to Tinode General
Hi, 
I try to setup tinode to work FCM push. My expectation is
1. Title: Sender name
2. Body: Message content
I can config notification body = message content by config body = "$content" in tinode.conf, but don't know how to config title = sender name. Please help me, thanks.
Below is my current configuration.
"apns": {
"msg": {
"body": "$content"
}
},

// Payload of AndroidNotification. If enabled, this will take precedence over data payload.
"android": {
// Set to false to push a data-only message.
"enabled": true,

// Android drawable resource ID to use as a notification icon.
"icon": "ic_logo_push",

// Notification color.
"color": "#3949AB",

// Name of intent filter which will catch this notification.
"click_action": "FLUTTER_NOTIFICATION_CLICK",

// Notification of a new message. You can include custom "icon", "color", "click_action"
// into this section and it will override the value above.
"msg": {
// Literal title string. Not recommended because it's not localized.

// Literal message body. Not recommended because it's not localized.
"body": "$content",

// Android string resource ID to use as a notification title. Localized.
// Takes precedence over "title". "new_message" is "New message" in Tindroid.
"title_loc_key": "",

// Android string resource ID to use as a notification body. Localized.
// Takes precedence over "body".
"body_loc_key": ""
},

// Notification of a new subscription. Same rules as section "msg" above.
"sub": {
// Android resource string ID to use as notification title. Localized.
// "new_chat" is "New chat" in Tindroid.
"title_loc_key": "",

// Android resource string ID to use as notification body. Localized.
"body_loc_key": ""
}
}
}
},

Gene

unread,
May 4, 2024, 2:15:15 PMMay 4
to Tinode General
There is no way to do it. And I'm not sure why you need this. Data-only messages is the way to go.

If you believe you need AndroidNotification pushes, please describe your use case.

thành phan

unread,
May 5, 2024, 12:59:49 PMMay 5
to Tinode General

Hi, thanks for your reply.

I see in Tinode android and ios, the notification title display as sender name already. My mobile client is using Flutter. How can I achieve this? Thanks
Here is the notification I got from Tinode android. 
Screenshot_2024-05-05-01-19-17-059_com.android.chrome.jpg

Gene

unread,
May 5, 2024, 2:51:03 PMMay 5
to Tinode General

thành phan

unread,
May 5, 2024, 9:53:28 PMMay 5
to Tinode General
Thanks.  Btw, why don't you allow server to support this behavior like notification body? (For example: title="$sub") In my opinion, this is quite obvious, someone sends you a message then the notification should be:
Title: Sender name
Body: Message content
Thanks.

Gene

unread,
May 6, 2024, 2:01:24 PMMay 6
to Tinode General
On Sunday, May 5, 2024 at 6:53:28 PM UTC-7 thành phan wrote:
Thanks.  Btw, why don't you allow server to support this behavior like notification body? (For example: title="$sub") In my opinion, this is quite obvious, someone sends you a message then the notification should be:

It's not that simple. The server generally does not know sender's name. It knows ID only. Such feature requires a database call (or passing it around when sending pushes) and parsing of the sender card. The server is currently not aware of the VCard format.

I also do not believe you really need it.

thành phan

unread,
May 6, 2024, 2:02:05 PMMay 6
to tin...@googlegroups.com
Hi, thanks for your reply.

I see in Tinode android and ios, the notification title display as sender name already. My mobile client is using Flutter. How can I achieve this? Thanks. 

--
You received this message because you are subscribed to a topic in the Google Groups "Tinode General" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tinode/1UbN09Nqe7k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tinode+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tinode/dc9c99f3-34bd-4db5-bf73-3d569f2a022dn%40googlegroups.com.

thành phan

unread,
May 6, 2024, 2:02:09 PMMay 6
to tin...@googlegroups.com
Here is the notification I got from Tinode android. 

Screenshot_2024-05-05-01-19-17-059_com.android.chrome.jpg

thành phan

unread,
May 24, 2024, 5:43:13 AMMay 24
to Tinode General
Thanks, I need to update the chat server source code. :(
Reply all
Reply to author
Forward
0 new messages