Cordova SDK

The Reteno Cordova Plugin for Mobile Customer Engagement and Analytics solutions

There are two ways to set up the SDK: give it to an AI coding agent, or follow the documentation on this page yourself.

To use an agent, open your app project in Claude Code, Cursor, or Codex and paste this prompt:

Integrate the Reteno Cordova SDK into this app. Follow:
https://docs.reteno.com/reference/cordova-ai-assisted-integration.md

Inspect the project, follow the instructions, and verify the integration. Ask me for any missing setup or device actions.

The agent works from this same documentation and verifies the result in Reteno. See Integrating Your App with Reteno for what you prepare for it.

Overview

Reteno is a plugin for Cordova that helps mobile teams integrate Reteno into their mobile apps.

The plugin supports:
  • Cordova 10.2 or later
  • iOS 15.0 or later
  • Android with cordova-android >= 12.0.0

[email protected] includes Reteno Android SDK 2.12.0 and Reteno iOS SDK 2.7.7.

Getting Started with Reteno Plugin / Setup guide

Initialize the SDK

RetenoPlugin.init(...) must be called after Cordova's native bridge is ready. Call it from the deviceready listener.

Cordova (vanilla JS)

document.addEventListener('deviceready', onDeviceReady, false);

function onDeviceReady() {
  RetenoPlugin.init({
    isDebugMode: false,
    pauseInAppMessages: false,
    pausePushInAppMessages: false,                // Android only
    inAppMessagesPauseBehaviour: 'POSTPONE_IN_APPS', // iOS only: 'SKIP_IN_APPS' | 'POSTPONE_IN_APPS'
    isAutomaticScreenReportingEnabled: false,     // iOS only
    lifecycleTrackingOptions: {                   // or 'ALL' / 'NONE'
      appLifecycleEnabled: true,
      foregroundLifecycleEnabled: false,
      pushSubscriptionEnabled: true,
      sessionStartEventsEnabled: true,
      sessionEndEventsEnabled: true,
    },
    sessionDurationSeconds: 30 * 60,              // Android 2.9.4+, iOS 2.7.0+
  })
    .then(() => console.log('Reteno initialized'))
    .catch((err) => console.error('init: ERROR', err));
}

Options reference

All fields are optional.

OptionTypeiOSAndroidNotes
accessKeystringāœ…āœ…Overrides RETENO_ACCESS_KEY (or legacy SDK_ACCESS_KEY) from config.xml. Usually not needed — see "Access key" below.
isDebugModebooleanāœ…āœ…Enables near real-time event monitoring. Use only on test devices.
pauseInAppMessagesbooleanāœ…āœ…Start the SDK with in-app messages paused.
pausePushInAppMessagesbooleanā€”āœ…Android-only. Safe to pass on iOS (ignored).
inAppMessagesPauseBehaviour'SKIP_IN_APPS' | 'POSTPONE_IN_APPS'āœ…ā€”iOS-only via init(). On Android use setInAppMessagesPauseBehaviour at runtime.
isAutomaticScreenReportingEnabledbooleanāœ…ā€”iOS-only. Not recommended in Cordova — use logScreenView() manually.
lifecycleTrackingOptionsobject | 'ALL' | 'NONE'āœ…āœ…See App Lifecycle Events. iOS: only via init().

Access key

Recommended: set RETENO_ACCESS_KEY in config.xml (or via cordova plugin add --variable RETENO_ACCESS_KEY=...). The plugin reads it automatically — no need to pass accessKey in JS. The deprecated SDK_ACCESS_KEY name remains supported for backward compatibility.

Only pass accessKey in init() when you need to override the value from config.xml at runtime.

Calling init() multiple times

init() is idempotent — the plugin caches the first successful initialization and subsequent calls resolve immediately without re-initializing the native SDK. Options passed to later calls are ignored.

Feature Guides

Licence

Reteno Cordova Plugin is released under the MIT license. See LICENSE for details.