Hey Elias,
I was really confident that I’ll get at least the android app running today when I read your post this morning, sadly I’m still stuck.
Yes I am running mattermost-push-proxy from the folder that contains config/aps_production_priv.pem
The main folder is /home/user/mattermost-push-proxy
ls -lha /home/user/mattermost-push-proxy/config
drwxrwxr-x 2 user user 4.0K Jul 4 09:13 .
drwxrwxr-x 5 user user 4.0K Jun 26 11:38 ..
-rw-rw-r-- 1 user user 2.2K Jun 23 16:48 aps_production.pem
-rw-rw-r-- 1 user user 1.8K Jun 23 16:48 aps_production_priv.pem
-rw-rw-r-- 1 user user 6 Apr 27 21:33 build.txt
-rw-rw-r-- 1 user user 440 Jul 4 09:08 mattermost-push-proxy.json
my mattermost-push-proxy.json looks like this(after I updated the AndroidApiKey value):
{
"ListenAddress":":8066",
"ThrottlePerSec":300,
"ThrottleMemoryStoreSize":50000,
"ThrottleVaryByHeader":"X-Forwarded-For",
"EnableMetrics": false,
"AndroidPushSettings":[
{
"Type":"android",
"AndroidApiKey":"AIzaSyD(OBSCURED)"
},
{
"Type":"android_rn",
"AndroidApiKey":"AIzaSyD(OBSCURED)"
}
]
}
and a screenshot from the firebase console
I also verified MY_SERVER_ID again
( SELECT * FROM Systems WHERE Name = 'DiagnosticId';
)
and rebuilt the app, installed it on my mobile and updated the curl command execution to the new MY_DEVICE_ID
(SELECT Email, DeviceId FROM Sessions, Users WHERE Sessions.UserId = Users.Id AND DeviceId != '' AND Email = 'my_email_address'; )
I restarted the mattermost-push-proxy afterwards. sadly, still the same “unauthorized” error:
curl http://127.0.0.1:8066/api/v1/send_push -X POST -H "Content-Type: application/json" -d '{ "message":"test", "badge": 1, "platform":"android", "server_id":"(MY_SERVER_ID)", "device_id":"(MY_DEVICE_ID)"}'
output {"error":"unknown transport error","status":"FAIL"}
output from /var/log/upstart/mattermost-push-proxy.log
2017/07/04 09:41:04 INFO Loading /home/user/mattermost-push-proxy/config/mattermost-push-proxy.json
2017/07/04 09:41:04 INFO Push proxy server is initializing…
2017/07/04 09:41:04 INFO Initializing Android notificaiton server for type=android
2017/07/04 09:41:04 INFO Initializing Android notificaiton server for type=android_rn
2017/07/04 09:41:04 INFO Server is listening on :8066
2017/07/04 09:41:09 INFO Sending android push notification for type=android
2017/07/04 09:41:10 ERROR Failed to send GCM push sid=(MY_SERVER_ID) did=(MY_DEVICE_ID) err=401 error: 401 Unauthorized type=android
If you have any other ideas how to debug this I’d appreciate every hint. and no matter if or if not, thank you for the time you have invested into helping me so far !!!
Cheers,
CoolMoeD