Push notification message cropped if message text too long

We use push notifications for SendBird chats defined via push notification template: ‘Je hebt een nieuw bericht van XXXXXXX in {channel_name}’

When the user types a very long message 5000 characters. The message content of push notification is cropped (even if we don’t need to include the message text itself in the notification message):

{
	"sentTime": 1615476004236,
	"data": {
		"sendbird": "{\"custom_type\":\"\",\"channel\":{\"channel_unread_message_count\":5,\"custom_type\":\"\",\"name\":\"Pavel 2\",\"channel_url\":\"68234bb6_c97a_4d4a_ade5_1dfdd52458b0\"},\"created_at\":1615476004027,\"message_id\":863360422,\"message\":\"abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! \\\"§ $%& \\/() =? * '<> |; ²³~ @`´ ©«» ¤¼× {} ...\",\"type\":\"MESG\",\"unread_message_count\":5,\"audience_type\":\"only\",\"sender\":{\"require_auth_for_profile_image\":false,\"profile_url\":\"\",\"name\":\"Pavel Zarecky\",\"id\":\"32489371-5142-41c0-99f4-c931aaca997e\"},\"push_sound\":\"default\",\"translations\":{},\"recipient\":{\"name\":\"p z\",\"push_template\":\"default\",\"id\":\"b0ab7639-efb2-4303-b0f1-b568e81ca26c\"},\"files\":[],\"category\":\"messaging:offline_notification\",\"channel_type\":\"group_messaging\",\"mentioned_users\":[],\"app_id\":\"REDACTED\"}",
		"message": "Je hebt een nieuw b..."
	},
	"messageId": "0:16154xxxxxxxxxxxxxxxxxxxxx",
	"ttl": 2419200,
	"from": "12345xxxxxx"
}

We understand the FCM payload is limited, by why the message based on template is cropped. Why not to crop only the message text itself?

Hey @p.zarecky,

Welcome to the Sendbird Community! I’d be happy to take a quick peak at this for you. Could you send me a DM with your Application ID so I can check a couple of things?

Thanks,
Tyler

@p.zarecky I want to better understand the core problem. Are the displayed notifications cut off to the user? Are you using that message payload for something else?

Thanks,
Tyler

Yes, the notification text is cut off, because it comes as cut off:

While in the template it is specified as: Je hebt een nieuw bericht van XXXXXXX in {channel_name}. If the user types a short message, the notification comes correctly.

Interesting. Let me set up an example using FCM. I was not able to reproduce this with iOS. I only received the template in iOS.

I’ll circle back when I’ve tested on FCM.

Thanks!

We can reproduce on both android/iOS

Would you be able to upload a screenshot of a notification that experiences this? Here is a test I did on iOS:

Note: This was 2000 characters

1 Like

You’re right, I didn’t provide the exact info. The cropping starts when sending more than ~2500 characters.

@p.zarecky,

I was able to reproduce the behavior. It seems like its an issue on APNs side truncating and not necessary Sendbird. A temporary work around would be to impose a client side restriction to the number of characters a user can send in a message. I’ll continue to look into this from out side.

1 Like

We get the same behaviour on android, so it looks more like coming directly from SendBird.