-
-
Notifications
You must be signed in to change notification settings - Fork 871
let apns support multi-cert #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
ff527c0 to
768bbf2
Compare
|
Hi! What's up with this change? |
|
Yeah, it would be good to have this change. The alternative is to setup 2 or more GoRush instances. |
|
Totally agreed to support multiple certs and multiple API keys. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There one error in code, I marked it
| return nil, errors.New("APNS key_password not exists") | ||
| } | ||
| path = PushConf.Ios.KeyMap[key] | ||
| password = PushConf.Ios.KeyMap[key] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
password = PushConf.Ios.KeyMap[key] needs to be changed to password = PushConf.Ios.KeyPass[key]
|
I would suggest intead of |
|
@appleboy Hey there |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think empty key InitAPNSClient("") is bad idea.
| LogError.Errorf("Key %s key_map not exist", key) | ||
| return nil, errors.New("APNS key_map not exists") | ||
| } | ||
| if _, ok := PushConf.Ios.KeyMap[key]; !ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KeyMap -> KeyPass
| return nil, errors.New("APNS key_password not exists") | ||
| } | ||
| path = PushConf.Ios.KeyMap[key] | ||
| password = PushConf.Ios.KeyMap[key] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KeyPass
| default: | ||
| err = errors.New("wrong certificate key extension") | ||
| func InitAPNSClient(key string) (*apns.Client, error) { | ||
| path, password := "", "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if PushConf.Ios.Enabled is false?
| notification.log = &log | ||
| notification.AddWaitCount() | ||
| } | ||
| fmt.Println("-----") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line
60a7a68 to
2c29b4b
Compare
bff0f2d to
6b6ef69
Compare
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
key "apns_client" will find the source from config.yaml.
Certificaton can set in config.yaml as followed
#99