Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Push Notifications: Development not working

Open dsjiern opened this issue 2 years ago • 2 comments

Description:

When developing an own whitelabeled App and trying to activate push notifications via APN in development mode not working.

Using a production iOS-App with a production APN device token (for example TestFlight) works fine!

Steps to reproduce:

  1. generate APN (production and development) Certificates and copy to the APN formula in settings
  2. disable production mode
  3. on restart: there is an error certificate does not support configured environment, production: true and APN isn't initialized

I tried to console.log the certificate and the environment informations in /app/bundle/programs/server/npm/node_modules/apn/lib/credentials/certificate/validate.js:

environment = { sandbox: true, production: false }
credentials = { [...], production: true }

so the credentials.production is always true, independant of the switch.

Instead setting the EndpointAddress.production in /app/bundle/programs/server/npm/node_modules/apn/lib/config.js manually to api.development.push.apple.com works.

Expected behavior:

Setting correctly to APN development mode when disabling production.

Actual behavior:

APN development not set correctly

Server Setup Information:

  • Version of Rocket.Chat Server: 6.4.4
  • Operating System: debian
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: enabled
  • NodeJS Version: 14.21.3
  • MongoDB Version: 5.0.22

dsjiern avatar Nov 01 '23 13:11 dsjiern

can i work on this?

nick2432 avatar Dec 15 '23 04:12 nick2432

i have same issues, did you resolve it!? @dsjiern ds

hallo43 avatar Dec 21 '24 10:12 hallo43