# mattermost-push-proxy not send push

**URL:** <https://forum.mattermost.com/t/mattermost-push-proxy-not-send-push/14117>\
**Category:** Mobile Apps\
**Created:** [September 22, 2022, 6:01pm UTC](https://forum.mattermost.com/t/mattermost-push-proxy-not-send-push/14117 "2022-09-22T18:01:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![serjsv87](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/serjsv87/32/5931_2.png) [@serjsv87](https://forum.mattermost.com/u/serjsv87)\
**Post date:** [September 22, 2022, 6:01pm UTC](https://forum.mattermost.com/t/mattermost-push-proxy-not-send-push/14117/1 "2022-09-22T18:01:32Z")

</div>

installed mattermost-push-proxy on the server, as well as on the docker. But push notifications do not come. Although there are no errors and I get a positive answer.  
in log all good

```auto
INFO: 2022/09/22 14:23:59 logger.go:62: Push proxy server is initializing...
GitVersion: v5.23.0
GitCommit: f9e1e09570ad6363c2d7b8323b3575a73b6a7a0e
GitTreeState: clean
BuildDate: '2022-04-26T11:34:53Z'
GoVersion: go1.17.6
Compiler: gc
Platform: linux/amd64

INFO: 2022/09/22 14:23:59 logger.go:62: Initializing Android notification server for type=android_rn
INFO: 2022/09/22 14:23:59 logger.go:62: Initializing Android notification server for type=android
INFO: 2022/09/22 14:23:59 logger.go:53: Server is listening on :8066

INFO: 2022/09/22 14:24:29 logger.go:62: Sending android push notification for device=android type=message ackId=dhdwxjcw8p8ruyz69w5ay9tnny
INFO: 2022/09/22 14:24:29 logger.go:62: Sending android push notification for device=android type=message ackId=mzg3nq7nm3n8dbao8k7waj511r
INFO: 2022/09/22 14:24:45 logger.go:62: Sending android push notification for device=android type=message ackId=suuishorgj8ti835q1jue64zbc

```

when test sending to firebase

```auto
 curl -X POST --header "Authorization: key=AAAxxx:xxxxxxeU3y5	" \
    --Header "Content-Type: application/json" \
    https://fcm.googleapis.com/fcm/send \
    -d '{"to":"dgjAaLV2SCGe5CEbgJwioO:APA91bFxxxxxxxxbC8s6cwAKwNuH9o","notification":{"title":"Hello333","body":"Yellow444"}}'

```

I get push.  
I tried to parse the code. I saw that a similar request is going

```auto
     curl -X POST --header "Authorization: key=AAAxxx:xxxxxxeU3y5" \
    --Header "Content-Type: application/json" \
    https://fcm.googleapis.com/fcm/send \
    -d '{"to":"dgjAaLV2SCGe5CEbgJwioO:APA91bFxxxxxxxxxbC8s6cwAKwNuH9o","data":{"post_id":"post_id","id_loaded":"id_loaded","sender_id":"","sender_name":"sender_name","team_id":"team_id", "message":"message", "type": "message", "server_id": "9n5k1h3n3xxxxx8qnh"}, "priority": "high"}'

```

I get an answer

```auto
{"multicast_id":2435644366889326912,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1663859867379871%c366a54ef9fd7ecd"}]}

```

But the push does not come to the device

**I will be glad for any help**

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [September 23, 2022, 3:28am UTC](https://forum.mattermost.com/t/mattermost-push-proxy-not-send-push/14117/2 "2022-09-23T03:28:39Z")

</div>

Hi serjsv87,

I see this request has also been posted in [GitHub](https://github.com/mattermost/mattermost-server/issues/21111) where you’ve been redirected to the [Community Chat](https://community.mattermost.com/core/pl/ychh7k9a83bu7eh9ibho9otybr). The [Peer-to-Peer Help](https://community.mattermost.com/core/channels/peer-to-peer-help) channel is a good place to ask questions like that, so let’s wait if someone answers there before we close this issue out here.

---

<div class="post-metadata">

**Author:** ![serjsv87](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/serjsv87/32/5931_2.png) [@serjsv87](https://forum.mattermost.com/u/serjsv87)\
**Post date:** [September 23, 2022, 6:28am UTC](https://forum.mattermost.com/t/mattermost-push-proxy-not-send-push/14117/3 "2022-09-23T06:28:08Z")

</div>

OK. we can wait.  
In the meantime I’m looking for a solution. but so far without success

---

<div class="post-metadata">

**Author:** ![serjsv87](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/serjsv87/32/5931_2.png) [@serjsv87](https://forum.mattermost.com/u/serjsv87)\
**Post date:** [September 23, 2022, 2:12pm UTC](https://forum.mattermost.com/t/mattermost-push-proxy-not-send-push/14117/4 "2022-09-23T14:12:53Z")

</div>

I made small changes. so far it helped me

git.patch

```auto
diff --git a/server/android_notification_server.go b/server/android_notification_server.go
index 9df076f..c0c96fc 100644
--- a/server/android_notification_server.go
+++ b/server/android_notification_server.go
@@ -4,6 +4,7 @@
 package server
 
 import (
+	"strings"
 	"time"
 
 	fcm "github.com/appleboy/go-fcm"
@@ -16,6 +17,13 @@ type AndroidNotificationServer struct {
 	AndroidPushSettings AndroidPushSettings
 }
 
+func truncateText(s string, max int) string {
+	if max > len(s) {
+ return s
+	}
+	return s[:strings.LastIndex(s[:max], " ")]
+}
+
 func NewAndroidNotificationServer(settings AndroidPushSettings, logger *Logger, metrics *metrics) NotificationServer {
 	return &AndroidNotificationServer{
 		AndroidPushSettings: settings,
@@ -80,6 +88,10 @@ func (me *AndroidNotificationServer) SendNotification(msg *PushNotification) Pus
 		To: msg.DeviceID,
 		Data: data,
 		Priority: "high",
+ Notification: &fcm.Notification{
+ Title: truncateText(msg.ChannelName, 75),
+ Body: truncateText(emoji.Sprint(msg.Message), 175),
+ },
 	}
 
 	if me.AndroidPushSettings.AndroidAPIKey != "" {
@@ -95,6 +107,7 @@ func (me *AndroidNotificationServer) SendNotification(msg *PushNotification) Pus
 
 		start := time.Now()
 		resp, err := sender.SendWithRetry(fcmMsg, 2)
+
 		if me.metrics != nil {
 			me.metrics.observerNotificationResponse(PushNotifyAndroid, time.Since(start).Seconds())
 		}

```
