0

我一直在尝试在我的服务器上配置推送代理。我已经从这里完成了完整的安装 mattermost-push-proxy

安装后我的服务器正在运行,但是当我想测试来自 curl 的通知时

curl http://172.104.182.36:8066/api/v1/send_push -X POST -H "Content-Type: application/json" -d '{ "message":"test", "badge": 1, "platform":"android", "server_id":"c5brhfxaeb8o3qkcc3dfc47coy", "device_id":"android:el99uTDjv0A:APA91bGnVbuZl9W2lQSSokXYECVa4Tgt-wrnOxQFh4r51pzdDaFxbXUrJXQgmcSaPYToyIA5Dc9CCLPvYPNBF8bnrZdCjOSIaJmgB0Uhusj-8IoVCtFfAkF_l_PfRq0TMQf7L_RYMLqo"}'

我收到了这个错误:

{"error":"unknown transport error","status":"FAIL"}

请帮我。谢谢

4

1 回答 1

0

First ensure that your config file has the appropriate certificates and ApiKeys like:

{
    "ListenAddress":":8066",
    "ThrottlePerSec":300,
    "ThrottleMemoryStoreSize":50000,
    "ThrottleVaryByHeader":"X-Forwarded-For",
  "EnableMetrics": false,
    "ApplePushSettings": [
        {
            "Type" : "apple_rnbeta",
            "ApplePushUseDevelopment": false,
            "ApplePushCertPrivate": "./config/aps_rnbeta_production_priv.pem",
            "ApplePushCertPassword": "",
            "ApplePushTopic": "com.mattermost.rnbeta"
        },
        {
            "Type" : "apple",
            "ApplePushUseDevelopment": false,
            "ApplePushCertPrivate": "./config/aps_rn_production_priv.pem",
            "ApplePushCertPassword": "",
            "ApplePushTopic": "com.mattermost.rn"
        }
    ],
    "AndroidPushSettings": [
        {
            "Type" : "android_rn",
            "AndroidApiKey": "AIzaSyA1sl9LXXXxXXXxXXXxXXXxX_XXXXXX"
        },
        {
            "Type" : "android",
            "AndroidApiKey": "AIzaSyA1sl9LXXXxXXXyXXXxXXXyX_XXXXYY"
        }
    ]
}

That being said just because you are using your own push-proxy server you need to build and compile the apps yourself so that the above certificates and Android ApiKeys match with your registered device tokens.

when building the app yourself don't forget to change the bundleId on iOS and packageId on Android so they also match with your certificates and keys.

于 2017-08-24T11:27:23.097 回答