# Push notification message cropped if message text too long

**URL:** <https://community.sendbird.com/t/push-notification-message-cropped-if-message-text-too-long/1852>\
**Category:** Sendbird Chat API/SDK\
**Tags:** group-channel, push-notification\
**Created:** [March 11, 2021, 3:35pm UTC](https://community.sendbird.com/t/push-notification-message-cropped-if-message-text-too-long/1852 "2021-03-11T15:35:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![p.zarecky](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@p.zarecky](https://community.sendbird.com/u/p.zarecky)\
**Post date:** [March 11, 2021, 3:35pm UTC](https://community.sendbird.com/t/push-notification-message-cropped-if-message-text-too-long/1852/1 "2021-03-11T15:35:39Z")

</div>

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):

```auto
{
	"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?

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [March 11, 2021, 3:38pm UTC](https://community.sendbird.com/t/push-notification-message-cropped-if-message-text-too-long/1852/2 "2021-03-11T15:38:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [March 11, 2021, 4:09pm UTC](https://community.sendbird.com/t/push-notification-message-cropped-if-message-text-too-long/1852/4 "2021-03-11T16:09:02Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![p.zarecky](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@p.zarecky](https://community.sendbird.com/u/p.zarecky)\
**Post date:** [March 11, 2021, 4:26pm UTC](https://community.sendbird.com/t/push-notification-message-cropped-if-message-text-too-long/1852/5 "2021-03-11T16:26:08Z")

</div>

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

> [@p.zarecky](#):
>
> `"message": "Je hebt een nieuw b..."`

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.

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [March 11, 2021, 4:28pm UTC](https://community.sendbird.com/t/push-notification-message-cropped-if-message-text-too-long/1852/6 "2021-03-11T16:28:11Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![p.zarecky](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@p.zarecky](https://community.sendbird.com/u/p.zarecky)\
**Post date:** [March 11, 2021, 4:30pm UTC](https://community.sendbird.com/t/push-notification-message-cropped-if-message-text-too-long/1852/7 "2021-03-11T16:30:08Z")

</div>

We can reproduce on both android/iOS

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [March 11, 2021, 4:59pm UTC](https://community.sendbird.com/t/push-notification-message-cropped-if-message-text-too-long/1852/8 "2021-03-11T16:59:21Z")

</div>

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

[![](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/8/80ce9829e4f53ea51c140052af8717501ee48dd7.jpeg "Community - 1852 - iOS Extended Message Push Test") ](https://www.youtube.com/watch?v=dQq02e71kVE)

_Note: This was 2000 characters_

---

<div class="post-metadata">

**Author:** ![p.zarecky](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@p.zarecky](https://community.sendbird.com/u/p.zarecky)\
**Post date:** [March 12, 2021, 7:27am UTC](https://community.sendbird.com/t/push-notification-message-cropped-if-message-text-too-long/1852/9 "2021-03-12T07:27:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [March 12, 2021, 12:50pm UTC](https://community.sendbird.com/t/push-notification-message-cropped-if-message-text-too-long/1852/10 "2021-03-12T12:50:49Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![p.zarecky](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@p.zarecky](https://community.sendbird.com/u/p.zarecky)\
**Post date:** [March 12, 2021, 4:13pm UTC](https://community.sendbird.com/t/push-notification-message-cropped-if-message-text-too-long/1852/11 "2021-03-12T16:13:42Z")

</div>

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