RocketChat / RocketChat/Rocket.Chat
Push Notifications: Development not working
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
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:
- generate APN (production and development) Certificates and copy to the APN formula in settings
- disable production mode
- on restart: there is an error
certificate does not support configured environment, production: trueand 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with production mode disabled, then inspect the APN integration and the referenced files /app/bundle/programs/server/npm/node_modules/apn/lib/credentials/certificate/validate.js and apn/lib/config.js. Compare the configured environment with the certificate values; done means development APN initialization succeeds without the certificate-environment error and production mode still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- backend, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100