Ionic Android SDK Setup

Installation

Requirement: cordova-android >= 12.0.0.

  1. Install plugin:
ionic cordova plugin add cordova-plugin-reteno --variable SDK_ACCESS_KEY=YOUR_KEY
  1. Install Ionic wrapper from npmjs:
npm install awesome-cordova-plugins-reteno @awesome-cordova-plugins/core

Choose the wrapper major that matches your @awesome-cordova-plugins/core (v5–v9). API is identical across versions — see the compatibility matrix in Setup overview.

  1. Add Android platform if needed:
ionic cordova platform add android

Configure via config.xml

<widget ...>
  <plugin name="cordova-plugin-reteno" spec="cordova-plugin-reteno">
    <variable name="SDK_ACCESS_KEY" value="YOUR_KEY" />
  </plugin>
</widget>

Notes:

  • SDK_ACCESS_KEY precedence: plugin variables (ionic cordova plugin add --variable ... or config.xml) → AndroidManifest meta-data injected by plugin.
  • If you changed plugin variables, usually you need reinstall/re-add:
    • ionic cordova plugin rm cordova-plugin-reteno && ionic cordova plugin add ...
    • or ionic cordova platform rm android && ionic cordova platform add android

Request Notification Permission (Android 13+)

Android 13+ (targetSdkVersion >= 33) requires runtime permission for notifications. The plugin injects POST_NOTIFICATIONS into the manifest, but you still must request it at runtime:

const granted = await this.reteno.requestNotificationPermission();
// granted: 1 — granted, 0 — declined

Initialize SDK

Use Platform.ready() and call this.reteno.init(...) once. Full example is in Setup overview.

Firebase Cloud Messaging

  • Download google-services.json from Firebase Console.
  • Place it in project root or resources/android/.

Official references:

Without Firebasex

If you do not need cordova-plugin-firebasex features, Reteno push still works on Android. For FCM to work, your Cordova Android project must have:

  1. google-services.json from Firebase Console.
  2. Google Services Gradle plugin (com.google.gms.google-services) applied.

How to verify:

  • platforms/android/app/google-services.json exists.
  • platforms/android/app/build.gradle contains com.google.gms.google-services.
  • Build logs do not contain google-services.json not found.

Warning: Reteno + Firebasex

If Firebasex registers its own FirebaseMessagingService, Reteno may not receive FCM callbacks.

Custom FCM Service (optional)

Only if you need custom native handling: extend RetenoFirebaseMessagingService and call super methods.

Capacitor Setup (Android)

Capacitor uses Cordova plugins through a compatibility layer, but does not execute Cordova plugin hooks. Some automatic steps from Cordova must be done manually.

1. Install plugin and sync

npm install cordova-plugin-reteno
npx cap sync android

Install the Ionic wrapper from npm:

npm install awesome-cordova-plugins-reteno @awesome-cordova-plugins/core

2. Configure SDK_ACCESS_KEY in capacitor.config.ts

import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  // ...
  cordova: {
    preferences: {
      SDK_ACCESS_KEY: 'YOUR_KEY',
    },
  },
};

export default config;

The plugin's reteno.gradle script automatically reads this value from capacitor.config.json (generated by Capacitor CLI from capacitor.config.ts) and patches the Android manifest at build time. No manual manifest editing is required.

Then run:

npx cap sync android

You can also pass key explicitly in JS:

await this.reteno.init({ accessKey: 'YOUR_KEY' });

3. Add google-services.json manually

Cordova hook that auto-copies google-services.json does not run in Capacitor.

  1. Download google-services.json from Firebase Console.
  2. Copy it to android/app/google-services.json.
  3. Run npx cap sync android.

4. Verify Google Services Gradle plugin

Check android/app/build.gradle contains:

apply plugin: 'com.google.gms.google-services'

If not, add it manually or install @capacitor-firebase/messaging (or similar).

5. Initialize and request permission

await this.reteno.init();
const granted = await this.reteno.requestNotificationPermission();

Deeplinks in Push Payloads

Reteno can deliver deeplinks, but routing inside Ionic app should be handled by app-level deeplink layer (scheme/App Links/provider).