{"record":{"id":"216dd0256060a25c","repo":"RocketChat/Rocket.Chat","slug":"warning-push-apn-is-in-development-mode","errorCode":null,"errorMessage":"WARNING: Push APN is in development mode","messagePattern":"WARNING: Push APN is in development mode","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/meteor/server/lib/notifications/push/apn.ts","lineNumber":132,"sourceCode":"\t}\n};\n\nexport const initAPN = ({ options, absoluteUrl }: { options: RequiredField<PushOptions, 'apn'>; absoluteUrl: string }) => {\n\tlogger.debug('APN configured');\n\n\tif (options.apn.gateway) {\n\t\t// We check the apn gateway i the options, we could risk shipping\n\t\t// server into production while using the production configuration.\n\t\t// On the other hand we could be in development but using the production\n\t\t// configuration. And finally we could have configured an unknown apn\n\t\t// gateway (this could change in the future - but a warning about typos\n\t\t// can save hours of debugging)\n\t\t//\n\t\t// Warn about gateway configurations - it's more a guide\n\n\t\tif (options.apn.gateway === 'gateway.sandbox.push.apple.com') {\n\t\t\t// Using the development sandbox\n\t\t\tlogger.warn('WARNING: Push APN is in development mode');\n\t\t} else if (options.apn.gateway === 'gateway.push.apple.com') {\n\t\t\t// In production - but warn if we are running on localhost\n\t\t\tif (/http:\\/\\/localhost/.test(absoluteUrl)) {\n\t\t\t\tlogger.warn('WARNING: Push APN is configured to production mode - but server is running from localhost');\n\t\t\t}\n\t\t} else {\n\t\t\t// Warn about gateways we dont know about\n\t\t\tlogger.warn({\n\t\t\t\tmsg: 'WARNING: Push APN unknown gateway',\n\t\t\t\tgateway: options.apn.gateway,\n\t\t\t});\n\t\t}\n\t} else if (options.production) {\n\t\tif (/http:\\/\\/localhost/.test(absoluteUrl)) {\n\t\t\tlogger.warn('WARNING: Push APN is configured to production mode - but server is running from localhost');\n\t\t}\n\t} else {\n\t\tlogger.warn('WARNING: Push APN is in development mode');","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/notifications/push/apn.ts#L114-L150","documentation":"During push initialization, the explicitly configured options.apn.gateway equals 'gateway.sandbox.push.apple.com', so iOS notifications are routed through Apple's sandbox environment. Sandbox pushes only deliver to development-signed app builds; App Store/production builds will silently receive nothing.","triggerScenarios":"Rocket.Chat push is configured with the sandbox APN gateway — normally deliberate, while testing push with a development iOS build and development push certificate.","commonSituations":"Mobile dev testing with Xcode builds; sandbox credentials left in place when promoting to production; copying a dev push config template wholesale.","solutions":["No action needed if you are intentionally testing a development build — verify the app is also dev-signed or pushes will not arrive","For production, remove the gateway override (or point it at 'gateway.push.apple.com') and use a production push certificate/token","Make sure cert/key match the environment: sandbox cert + sandbox gateway, prod cert + prod gateway","Remove the explicit gateway option entirely and let the APN client infer the environment from the credentials"],"exampleFix":"// before\npush: { apn: { gateway: 'gateway.sandbox.push.apple.com', ... } }\n\n// after (production)\npush: { production: true, apn: { ... } } // no gateway override","handlingStrategy":"validation","validationCode":"const KNOWN_APN_GATEWAYS = ['gateway.sandbox.push.apple.com', 'gateway.push.apple.com'];\n\nif (options.apn.gateway === 'gateway.sandbox.push.apple.com' && process.env.NODE_ENV === 'production') {\n  throw new Error('Refusing to start with sandbox APN gateway in production');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit apn.gateway and let the APN client infer the environment from the credentials","Keep dev and prod push credentials in separate env files","Smoke-test push to a production build before release"],"tags":["push","apn","ios","configuration"],"backgroundTag":"apn-gateway-misconfiguration","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}