fix: default APNs delivery to production (#2381)

Issue: TestFlight iOS clients register production APNs device tokens, but notifications from a default OpenChamber server are not delivered.

Expected behavior: the released iOS app receives notifications without requiring users to configure an APNs environment, while development builds can explicitly select sandbox delivery.

Root cause: both relay and direct APNs delivery defaulted to the sandbox environment, so production TestFlight tokens were sent to the wrong APNs endpoint.

Fix: default both delivery modes to production, preserve OPENCHAMBER_APNS_ENVIRONMENT=sandbox as an explicit development override, and update tests and documentation.
This commit is contained in:
natheihei
2026-07-23 13:21:40 +03:00
committed by GitHub
parent a1784b8697
commit 12e2c55171
4 changed files with 31 additions and 6 deletions
@@ -256,7 +256,7 @@ export const createApnsRuntime = (deps) => {
teamId,
p8,
bundleId: bundleId || DEFAULT_BUNDLE_ID,
environment: environment === 'production' ? 'production' : 'sandbox',
environment: environment === 'sandbox' ? 'sandbox' : 'production',
};
};
@@ -374,9 +374,9 @@ export const createApnsRuntime = (deps) => {
url,
registerUrl: url.replace(/\/send$/, '/register-token'),
environment:
(trimmedEnv('OPENCHAMBER_APNS_ENVIRONMENT') || 'sandbox').toLowerCase() === 'production'
? 'production'
: 'sandbox',
(trimmedEnv('OPENCHAMBER_APNS_ENVIRONMENT') || 'production').toLowerCase() === 'sandbox'
? 'sandbox'
: 'production',
};
};