Move your Cordova integration to production

When you have finished integrating and testing the Connect SDK in development, work through this checklist to move your integration to production.

Language: JavaScript, with TypeScript definitions

Availability: Pro, Premium and Ultimate


Switch the SDK to the release build

In development, ConnectConfig.json uses "useRelease": false, which pulls in the AcousticConnectDebug iOS pod. Before releasing, switch to the release build - this replaces it with the AcousticConnect release pod, which suppresses verbose logging regardless of Xcode build configuration.

  1. Open ConnectConfig.json in the root of your project and set useRelease to true.
{
  "Connect": {
    "useRelease": true,
    ...
  }
}
  1. Remove and re-add the iOS platform. A plain cordova prepare won't pick up the change - removing the platform and re-adding it triggers a clean install. This ensures a clean build with the correct pod in all targets.
npx cordova platform rm ios
npx cordova platform add ios
npx cordova build ios

This only affects iOS. Android always uses the same release SDK artifact regardless of useRelease.


Update push notification settings

Create a dedicated production integration in Connect. This is required for iOS because the APNs environment and version key must match your Distribution-signed build. For Android it's recommended - it keeps test data out of production analytics and prevents campaigns from reaching test devices.

The production version appears as a separate app all across Connect - in Analytics, Segmentation, Message composer, Campaigns and Sessions.

Step 1: Update platform credentials

  1. Create a production Firebase project in the Firebase console and download its google-services.json.
  2. Replace google-services.json at your Cordova project root with this file.
🚧

Warning

The Cordova plugin only reads one google-services.json from the project root - there's no automatic build-type switching like native Android's app/src/debug/ and app/src/release/ folders. If you don't use separate branches for development and production, swap the file manually before each build.

  1. Generate a service account key for the production project (Settings > Service accounts > Generate new private key).
  2. Share the service account key with your Connect administrator.
  3. If you haven't already, replace your test notification icon with your own branded icon - see Add a notification icon.

Step 2: Create a production integration in Connect

Ask your Connect administrator to create a dedicated production Mobile app integration and share the new app key and collector URL with you.

What exactly the Connect administrator does
  1. General settings - under Configurations, select both Analytics and Marketing. Assign a descriptive name to the app to differentiate it from the development version (for example, "My App - Prod").
General settings for mobile app
  1. External settings - Copy the app key and collector URL from here. The collector URL can differ from the one in your project if your company has separate production and testing subscriptions.
External settings for mobile app
  1. iOS Mobile Push Notifications - All values are the same as for your development integration, except for Environment which must be Production for a Distribution-signed build. A mismatch breaks push delivery.
iOS settings
  1. Android Firebase Mobile Push Notifications - Requires the production Firebase service account key from Step 1 above.
Android settings
  1. Huawei Mobile Services Push Notifications - leave this off. Huawei push isn't supported for hybrid apps.
  2. Confirmation - save the integration.

Step 3: Update your project and test

  1. Update AppKey and PostMessageUrl in ConnectConfig.json with the production values from your Connect administrator.
  2. Run npx cordova prepare to sync the updated configuration into the platform directories.
  1. Add a location usage description to config.xml with wording appropriate for your app. The Connect SDK includes location APIs, and Apple requires this string before you can upload to App Store Connect.
<platform name="ios">
    <edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
        <string>This app uses your location to show nearby stores and local offers.</string>
    </edit-config>
</platform>
  1. Remove and re-add the iOS platform to pick up the new configuration cleanly:
npx cordova platform rm ios
npx cordova platform add ios
  1. In Xcode, set the Run scheme's build configuration to Release.
  2. Archive and distribute via TestFlight to an iPhone.
  3. Launch the app on the device and grant notification permission when prompted.
  4. Coordinate with your marketing team to send a test push to your device or do it yourself - see Test your push notification setup.
  5. Verify the notification appears and push signals appear in the contact's activity feed in Connect.

Did this page help you?