pushd icon indicating copy to clipboard operation
pushd copied to clipboard

Multiple APNS certificates

Open pmbnecc opened this issue 10 years ago • 15 comments

I have multiple iPhone apps that will use my PUSHd. It appears that I need an individual APNs certificate from Apple for each of these apps. Is there a way for the coffee.settings to be able to handle multiple APNs certificates?

pmbnecc avatar Apr 20 '15 01:04 pmbnecc

on my server, it's works .I just create multiple instance on pushd(don't forget to change the port or you'll have conflict ) .if you have some trouble you can send me an email via [email protected]

deweweire avatar Apr 20 '15 07:04 deweweire

Thanks. I am aware of that possibility, but I may have thousands of individual apps.

pmbnecc avatar Apr 20 '15 14:04 pmbnecc

i didn't find yet another solution .If i find it i'll share to you :) Do the same if you can :)

deweweire avatar Apr 20 '15 14:04 deweweire

I may have found my answer: In the settings.coffee file, I can add another exports['apns1'] and change the cert: and key: for the new app. Then, in the app itself, it can reference 'apns1' instead of 'apns' when communicating with the pushd server. I will try this at home tonight...

pmbnecc avatar Apr 20 '15 14:04 pmbnecc

i'll check tomorrow also .Keep me up to date and i do the same ;)

deweweire avatar Apr 20 '15 14:04 deweweire

i hope that they will be no trouble with the redis database

deweweire avatar Apr 20 '15 14:04 deweweire

Why I think it will work: We can have 'apns' and 'apns-dev' in settings.coffee. There is nothing magical in those names.

Why do you think that there might be trouble in the redis database?

pmbnecc avatar Apr 20 '15 14:04 pmbnecc

yes you're right never mind

deweweire avatar Apr 20 '15 14:04 deweweire

I renamed my main apns entry in settings.coffee, and my main app still works. Tomorrow I will get the new certificate and new app running, modifying settings.coffee to take the new certificate for the new app.

pmbnecc avatar Apr 21 '15 02:04 pmbnecc

I modified settings.coffee with the new information, and the new certificate for the new app, and it worked as expected!

pmbnecc avatar Apr 22 '15 18:04 pmbnecc

I am also running multiple instances. But just wondering how can you have multiple exports [apns] & [apns1] and refer to them from the app?

tmnuwan12 avatar Jan 28 '16 08:01 tmnuwan12

If my memories are good, it's when you try to register and you said it's apns1 or apns

deweweire avatar Jan 28 '16 09:01 deweweire

You mean for proto="apns1" or proto="apns2" when you subscribe? Thanks.

tmnuwan12 avatar Jan 28 '16 11:01 tmnuwan12

long time i didn't configure it but i think yes ^^

deweweire avatar Jan 28 '16 14:01 deweweire

You can export another setting in coffe file like this:

.
.
.

exports['apns'] =
    enabled: yes
    class: require('./lib/pushservices/apns').PushServiceAPNS
    # Convert cert.cer and key.p12 using:
    # $ openssl x509 -in cert.cer -inform DER -outform PEM -out apns-cert.pem
    # $ openssl pkcs12 -in key.p12 -out apns-key.pem -nodes
    cert: 'apns-cert.pem'
    key: 'apns-key.pem'
    cacheLength: 100
    # Uncomment to set the default value for parameter.
    # This setting not overrides the value for the parameter that is set in the payload fot event request.
    # category: 'show'
    # contentAvailable: true
    # Selects data keys which are allowed to be sent with the notification
    # Keep in mind that APNS limits notification payload size to 256 bytes
    payloadFilter: ['messageFrom']
    # uncommant for dev env
    gateway: 'gateway.sandbox.push.apple.com'
    address: 'feedback.sandbox.push.apple.com'

exports['apns-alt'] =
    enabled: yes
    class: require('./lib/pushservices/apns').PushServiceAPNS
    # Convert cert.cer and key.p12 using:
    # $ openssl x509 -in cert.cer -inform DER -outform PEM -out apns-cert.pem
    # $ openssl pkcs12 -in key.p12 -out apns-key.pem -nodes
    cert: 'apns-cert-alt.pem'
    key: 'apns-key-alt.pem'
    cacheLength: 100
    # Uncomment to set the default value for parameter.
    # This setting not overrides the value for the parameter that is set in the payload fot event request.
    # category: 'show'
    # contentAvailable: true
    # Selects data keys which are allowed to be sent with the notification
    # Keep in mind that APNS limits notification payload size to 256 bytes
    payloadFilter: ['messageFrom']
    # uncommant for dev env
    gateway: 'gateway.sandbox.push.apple.com'
    address: 'feedback.sandbox.push.apple.com'

.
.
.

just don't forget to change proto key in /subscribers request according the name you decided... probably a good practice is to use your app identifier.

fabiosoft avatar Nov 05 '16 00:11 fabiosoft