Overview

What do you need for integration?

  • An account to access into indigitall console. If you don't have it, please contact with us here.
  • The next thing is to have a project associated with the application web (web browsers) and / or mobile (android, ios). See more details here.

It is important since the project contains the configuration data of your application, that is, the domain where your website is hosted, the safari or iOS certificates or the firebase key that android uses. It all depends on the platforms (web or app) that the project uses.

  • You will need the App Key of the project, which is the key that our system uses to identify it, so it is unique for each project. You can find it in the administration console within the Configuration section in the Projects tab. You can see it in the following image, and to copy it, it is easy to click on the icon next to the key (App Key)

Integration

This article shows the minimum development that must be done to start registering devices and being able to carry out the first push campaigns.

The Indigitall SDK is compatible with Google messaging services, through the Firebase platform and with the services of HMS or Huawei Mobile Services of Huawei .

You can see it in this tutorial video or read the instructions below:

🤖 Click to expand AI Integration Prompt (ChatGPT / Copilot / Claude)

Copy and paste this prompt into your AI assistant to accelerate your integration:

		
# Prompt: Integrate indigitall-cordova-plugin Push Notifications in a Cordova App

You are a senior mobile integration engineer. Implement push integration for a Cordova app using the plugin indigitall-cordova-plugin.

Project context:
- Local plugin folder in this repository: sdk
- Plugin id: indigitall-cordova-plugin
- Target app: Cordova app project that consumes this plugin

## Hard Rule Before Coding
Do not modify any file until all mandatory questions below are answered.

## Mandatory Questions (Ask First)
1. What is your Indigitall appKey?
2. What is your Indigitall senderId?
3. Do you have a private cloud URL for device API? If yes, provide it. If not, this parameter must not be added.
4. Do you want location enabled? Answer yes or no.
5. Do you want Huawei HMS support included? Answer yes or no.
6. Which plugin installation method do you want to use in your app project? npm, cordova plugin add, or another method.
7. For iOS Notification Service Extension code, do you want Swift or Objective-C?
8. In which screen or JS file do you want to receive push notification data? Provide the file/function name where `onIndigitallGetPush` should be registered.

After collecting answers, print a short implementation plan with the resolved options and only then start code changes.

## Implementation Rules
- Never duplicate existing XML/Gradle/manifest entries.
- If location is disabled, do not add any location setting on Android or iOS.
- If private cloud URL is empty or not provided, do not add urlDeviceApi in initialization.
- If HMS is disabled, keep Android dependency excluding module android-hms.
- Keep existing project style and structure.

## Step 1: Install the Plugin in the App Project
Use the installation method selected by the user.

Example options:
- npm: npm install indigitall-cordova-plugin
- cordova CLI: cordova plugin add indigitall-cordova-plugin

## Step 2: Android config.xml Setup
After plugin installation, ensure this exists inside the Android platform section:

```xml

    
    ...


```

If HMS is enabled, also add:

```xml

    
    ...


```

HMS file source reminder:
- agconnect-services.json comes from Huawei Developer Console.

## Step 3: Android Gradle Setup
If HMS is enabled, add Huawei repositories and plugin/classpath where appropriate in app and project Gradle files.

Use the following reference block:

```groovy
apply plugin: 'com.huawei.agconnect'

buildscript {
    repositories {
        ...
        maven { url 'https://developer.huawei.com/repo/' }
    }
    dependencies {
        ...
        classpath 'com.huawei.agconnect:agcp:1.7.3.300'
    }
}

allprojects {
    repositories {
        ...
        maven { url 'https://developer.huawei.com/repo/' }
    }
}

...

dependencies {
    implementation fileTree(dir: 'libs', include: '*.jar')
    // SUB-PROJECT DEPENDENCIES START
    ...
    implementation "com.huawei.hms:push:6.7.0.300"
    // SUB-PROJECT DEPENDENCIES END
}
```

Repository management reference (when applicable):

```groovy
dependencyResolutionManagement {
    ...
    repositories {
        google()
        jcenter()
        maven { url 'https://developer.huawei.com/repo/' }
    }
}
```

If HMS is NOT enabled, keep dependency with exclude in app-build-extras.gradle style:

```groovy
implementation('com.indigitall:android:x.y.+') {
   exclude group: 'com.indigitall', module: 'android-hms'
}
```

Notes:
- Replace x.y with the target SDK major/minor used by your project. Current baseline usually uses 7.0.+.
- Validate dependency versions against current plugin/dependency files before finalizing.

## Step 4: Android Manifest Updates
Check if entries exist first. Add only missing entries.

Always required:

```xml



```

If location is enabled:

```xml





  
    
  


```

If HMS is enabled:

```xml

    
        
    


```

## Step 5: MainActivity Permission Callback
Add this in MainActivity (Java or Kotlin depending on project language).

Java reference:

```java
import com.indigitall.android.Indigitall;
import com.indigitall.android.commons.Constants;
...
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
  super.onRequestPermissionsResult(requestCode, permissions, grantResults);
  for (String permission : permissions) {
    if (Manifest.permission.POST_NOTIFICATIONS.equals(permission)) {
      Indigitall.onRequestPermissionsResult(this, Constants.REQUEST_PERMISSION_CODE, permissions, grantResults);
    }
  }
}
```

Kotlin equivalent reference:

```kotlin
import com.indigitall.android.Indigitall
import com.indigitall.android.commons.Constants
...
override fun onRequestPermissionsResult(
    requestCode: Int,
    permissions: Array,
    grantResults: IntArray
) {
    super.onRequestPermissionsResult(requestCode, permissions, grantResults)
    permissions.forEach { permission ->
        if (permission == Manifest.permission.POST_NOTIFICATIONS) {
            Indigitall.onRequestPermissionsResult(
                this,
                Constants.REQUEST_PERMISSION_CODE,
                permissions,
                grantResults
            )
        }
    }
}
```

## Step 6: JS Initialization in Cordova
Add initialization in app JS startup flow:

```javascript
window.plugins.indigitall.init({
    appKey: YOUR_APP_KEY,
    senderId: YOUR_SENDER_ID,
    requestLocation: true, //only if user enabled location
    urlDeviceApi: "", //only if private cloud URL is provided
    logLevel: LogLevel.DEBUG
}, device => {
    console.log("Device init: ", JSON.stringify(device));
}, device => {
    console.log('device: ' + device.deviceId);
}, errorMessage => {
    console.log('error: ' + errorMessage);
});
```

Conditional rules for final init object:
- Set requestLocation to true only if user enabled location.
- If location is disabled, set requestLocation to false and do not add platform location configuration.
- If private cloud URL is not provided, remove urlDeviceApi from the object instead of leaving empty.

## Step 6.1: Push Data Reception (`onIndigitallGetPush`)

In the screen or JS file indicated by the user, register the push data listener:

```javascript
window.plugins.indigitall.onIndigitallGetPush(push => {
    console.log("PUSH onIndigitallGetPush: ", JSON.stringify(push));
}, (error) => {
    console.log("ERROR onIndigitallGetPush: ", error);
});
```

> Register this listener once, after the `deviceready` event fires, in the component or page specified by the user.
Run on terminal in the iOS platform folder:

```bash
pod repo update
pod install
```

Enable iOS capabilities in Xcode for the app target:
- Push Notifications
- Background Modes:
  - Remote notifications
  - Background fetch
  - Location updates only if location is enabled

Ensure push entitlements are configured:
- Debug: aps-environment = development
- Release: aps-environment = production

If location is enabled, ensure Info.plist contains proper usage descriptions:
- NSLocationWhenInUseUsageDescription
- NSLocationAlwaysAndWhenInUseUsageDescription
- NSLocationAlwaysUsageDescription where applicable

If location is disabled, do not add location background mode or location usage keys.

## Step 8: Notification Service Extension (NSE)
Create NSE target in Xcode:
1. File > New > Target
2. Choose Notification Service Extension
3. Name it NotificationService
4. Activate scheme when prompted
5. Add Indigitall library to the NSE target dependencies

Then add code according to selected language.

Swift:

```swift
import Indigitall
class NotificationService: UNNotificationServiceExtension {

    var contentHandler: ((UNNotificationContent) -> Void)?
    var bestAttemptContent: UNMutableNotificationContent?
    var request: UNNotificationRequest?

    override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
        self.contentHandler = contentHandler
        self.request = request
        self.bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)

        Indigitall.didReceive(self.request!, withContentHandler: self.contentHandler!)
    }

    override func serviceExtensionTimeWillExpire() {
        if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
            Indigitall.serviceExtensionTimeWillExpire(bestAttemptContent, withContentHandler: contentHandler)
        }
    }

}
```

Objective-C:

```objectivec
# import 
# import 

API_AVAILABLE(ios(10.0))
// NotificationService.h
@interface NotificationService : UNNotificationServiceExtension
@end

// NotificationService.m
@interface NotificationService ()

@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);
@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;
@property (nonatomic, strong) UNNotificationRequest *request;

@end

@implementation NotificationService

- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
    self.contentHandler = contentHandler;
    self.bestAttemptContent = [request.content mutableCopy];
    self.request = request;

    [Indigitall didReceiveNotificationRequest:self.request withContentHandler:self.contentHandler];
}

- (void)serviceExtensionTimeWillExpire {
    if (self.contentHandler != nil && self.bestAttemptContent != nil) {
        [Indigitall serviceExtensionTimeWillExpire:self.bestAttemptContent withContentHandler:self.contentHandler];
    }
}

@end
```

## Step 9: Dependency and Integration Validation Checklist
Before closing the task, verify all of the following:
- Engine requirements match plugin requirements (cordova, cordova-android, cordova-ios, Xcode, iOS minimum).
- Android files present: google-services.json and agconnect-services.json only when HMS is enabled.
- No duplicated manifest permissions/services/receivers.
- Android builds successfully.
- iOS pods install successfully and app builds successfully.
- Push permission flow works and no runtime errors in logs.
- Device registration callback is executed and device id is logged.
- Optional branches tested:
  - Location enabled branch
  - Location disabled branch
  - HMS enabled branch
  - HMS disabled branch

## Expected Delivery Format
At the end, return:
1. Summary of user answers and resolved options.
2. Exact list of changed files.
3. Diff-style snippets for each change.
4. Validation results and pending manual tasks, if any.

Official documentation (place at the end as requested):
https://documentation.indigitall.com/reference/initial-sdk-setup-3

> ⚠️ AI can make mistakes. Always verify everything it does before treating it as valid.
		
	

Our SDK is available via npm.

npm (Node Package Manager) it is a package management system. It consists of a command line client and an online database of public and private packages.

Import the plugin
To import the SDK into your project, follow these steps:

  1. Open the console and position yourself at the root of the project.
$ cd /PATH/TO/YOUR/PROJECT
  1. Run this line in the console to import the plugin:
$ cordova plugin add indigitall-cordova-plugin