gorush icon indicating copy to clipboard operation
gorush copied to clipboard

let apns support multi-cert

Open lbeeon opened this issue 7 years ago • 5 comments

I modified sort of the code, let the ios could support multiple certifications. The usage was same as the andriod platform. Make a request as followed

{
  "notifications": [
    {
      "tokens": ["token_a", "token_b"],
      "platform": 1,
      "message": "Hello World iOS!",
      "apns_client": "cert1",
    }
  ]
}

key "apns_client" will find the source from config.yaml. Certificaton can set in config.yaml as followed

ios:
  key_map:
    cert1: "key.pem"
    cert2: "cert2.pem"
    cert3: "cert3.pem"
  key_password:
    cert1: ""
    cert2: ""
    cert3: ""

#99

lbeeon avatar Sep 27 '17 02:09 lbeeon

Hi! What's up with this change?

janekolszak avatar Nov 22 '17 10:11 janekolszak

Yeah, it would be good to have this change. The alternative is to setup 2 or more GoRush instances.

kemotes avatar Nov 23 '17 11:11 kemotes

Totally agreed to support multiple certs and multiple API keys.

itsnotvalid avatar Dec 01 '17 03:12 itsnotvalid

I would suggest

ios:
  keys:
  - cert: "key.pem"
    password: ""
  - cert: "cert2.pem"
    password: ""
  - cert: "cert3.pem"
    password: ""

intead of

ios:
  key_map:
    cert1: "key.pem"
    cert2: "cert2.pem"
    cert3: "cert3.pem"
  key_password:
    cert1: ""
    cert2: ""
    cert3: ""

mxpv avatar Mar 26 '18 18:03 mxpv

@appleboy Hey there Is there any chance this will be merged or any other way of supporting multiple apns certificated will be implemented?

Struik avatar May 23 '18 10:05 Struik