【问题标题】:How to create an APNS sandbox channel in Amazon Pinpoint?如何在 Amazon Pinpoint 中创建 APNS 沙盒通道?
【发布时间】:2019-04-24 15:57:09
【问题描述】:

我有一个 .p12 文件形式的 APNS 沙盒证书和一个密码。我看不到使用 AWS 控制台上传它的方法。 CLI 中记录了一种方法应该允许它:

https://docs.aws.amazon.com/cli/latest/reference/pinpoint/update-apns-sandbox-channel.html

但是,它需要证书和私钥作为单独的字符串参数。我尝试使用 OpenSSL 将它们分开,但是每次我收到以下错误消息:

An error occurred (BadRequestException) when calling the UpdateApnsChannel operation: The certificate provided is not a valid Apple certificate

有没有办法在 Amazon Pinpoint 中使用沙盒证书?

【问题讨论】:

    标签: amazon-web-services aws-pinpoint


    【解决方案1】:

    最后,我能够通过在尝试上传证书时在 AWS 控制台中劫持 AJAX 请求来做到这一点。 JSON 正文包含可与 CLI 命令一起使用的 privateKey 和 certificate 参数。

    aws pinpoint update-apns-sandbox-channel --cli-input-json "file://path-to-request-object.json"
    

    请求对象文件如下所示:

    {
      "APNSSandboxChannelRequest": {
        // Both certificate and private key are copied from AJAX request from AWS console
        "Certificate": "-----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----\n",
        "PrivateKey": "-----BEGIN PRIVATE KEY-----\n.....\n-----END PRIVATE KEY-----\n"
        "Enabled": true
      },
      "ApplicationId": "app-id-here"
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-01-19
      • 2012-08-06
      • 2022-01-07
      • 2015-04-17
      • 1970-01-01
      • 2023-03-24
      • 1970-01-01
      相关资源
      最近更新 更多