Android

Overview

Unlike iOS, Android currently does not offer a native Live Activities system. However, similar behavior can be achieved using standard notifications, including persistent (ongoing) notifications and silent pushes.

With our SDK, you can start, update, and end a Live Activity-like experience on Android by sending push notifications that reflect the current state of an event (e.g., delivery progress, workout status, or timers). These notifications can remain fixed in the status bar, update dynamically, or disappear when the activity ends.

We support both:

  • Visible notifications: Useful for ongoing user-facing events.
  • Silent pushes: Ideal for background updates without interrupting the user.

This approach allows full flexibility:
You can control layout, content, priority, actions, or custom sounds—just like with any other Android notification.

Our SDK handles:

  • Device registration
  • Push reception (visible or silent)
  • Dynamic notification management (create/update/cancel)

📘

Live Activities on Android are powered entirely by push logic and custom notification handling—giving you full control and compatibility across Android versions.

Limitations

  • Bulk message delivery is supported on devices running Android 5.0 (API 21) and above.
  • Currently, Live Activities on Android are a custom implementation via the SDK, not a native feature like on iOS.

Live Activities on Android – Integration Options

In Android, Live Activities can be implemented in two different ways when using the Cordova SDK:

  1. Via JavaScript methods (Cordova SDK) – The SDK provides dedicated JavaScript methods to create, update, and close Live Activities directly from your Cordova application code. (Detailed instructions for this approach are provided in the following section.)
  2. Natively (Android code) – If you prefer to work at the native Android level, you can integrate Live Activities directly in your Android project. This approach provides full access to native features and customization. You can follow our step-by-step guide here: Native Android Live Activities Integration.

Both options are fully compatible and can be used independently or in combination, depending on your project’s requirements and development workflow.

JavaScript API Reference

All methods return results asynchronously through callbacks.

Log In

Registers the device in Live Activities with an externalCode provided by your backend.

window.plugins.indigitallLA.logIn("yourExternalCode", (deviceId) => {
  console.log("Device registered:", deviceId);
}, (error) => {
  console.error("Login error:", error);
});


Log Out

Unregisters the device from Live Activities.

window.plugins.indigitallLA.logOut((deviceId) => {  
  console.log("Device logged out:", deviceId);  
}, (error) => {  
  console.error("Logout error:", error);  
});

⚠️

The topics used for Live Activities are not the same as those used for the push notification service. Make sure to configure and subscribe to the correct topics so Live Activities work independently.

List Subscribed Topics

Retrieves a list of topics to which the device is currently subscribed.

window.plugins.indigitallLA.topicsList((topics) => {  
  console.log("Subscribed topics:", topics);  
}, (error) => {  
  console.error("Topics list error:", error);  
});

Subscribe to Topics

Adds the device to one or more topics.

window.plugins.indigitallLA.topicsSubscribe(["order_123", "match_live"], (topics) => {  
  console.log("Successfully subscribed:", topics);  
}, (error) => {  
  console.error("Subscribe error:", error);  
});

Unsubscribe from Topics

Removes the device from one or more topics.

window.plugins.indigitallLA.topicsUnsubscribe(["order_123"], (topics) => {  
  console.log("Successfully unsubscribed:", topics);  
}, (error) => {  
  console.error("Unsubscribe error:", error);  
});

Push Reception Callback

Registers a callback to handle incoming push notifications, including Live Activity events.

window.plugins.indigitallLA.onMessageReceived((pushData) => {  
  console.log("Push received:", pushData);  
  // Parse pushData to handle START, UPDATE, or END of a Live Activity  
}, (error) => {  
  console.error("Push reception error:", error);  
});

Typical Workflow in Cordova

  1. Log in the device with an externalCode.
  2. Subscribe to the topics representing the Live Activities you want to track.
  3. Listen for push notifications via onMessageReceived and update your UI accordingly.
  4. Unsubscribe or log out when the Live Activity ends or the user session changes.

Example: Full Live Activities Workflow in Cordova


Below is a complete example of how to:

  1. Log in the device to Live Activities.
  2. Subscribe to one or more topics.
  3. Listen for push notifications (START, UPDATE, END events).
  4. Unsubscribe and log out when needed.
// 1. Log in the device with an externalCode
window.plugins.indigitallLA.logIn("yourExternalCode", (deviceId) => {
  console.log("Device registered:", deviceId);

  // 2. Subscribe to desired topics after login
  const topicsToSubscribe = ["order_123", "match_live"];
  window.plugins.indigitallLA.topicsSubscribe(topicsToSubscribe, (topics) => {
    console.log("Successfully subscribed:", topics);
  }, (error) => {
    console.error("Subscribe error:", error);
  });

}, (error) => {
  console.error("Login error:", error);
});

// 3. Listen for push notifications
window.plugins.indigitallLA.onMessageReceived((pushData) => {
  console.log("Push received:", pushData);

  // Example handling based on Live Activity event type
  if (pushData.pushType === "LIVE_ACTIVITY") {
    if (pushData.liveActivityEventType === "START") {
      console.log("Live Activity started:", pushData);
    } else if (pushData.liveActivityEventType === "UPDATE") {
      console.log("Live Activity updated:", pushData);
    } else if (pushData.liveActivityEventType === "END") {
      console.log("Live Activity ended:", pushData);
    }
  }

}, (error) => {
  console.error("Push reception error:", error);
});

// 4. Optional: Unsubscribe from topics when the event ends
window.plugins.indigitallLA.topicsUnsubscribe(["order_123"], (topics) => {
  console.log("Successfully unsubscribed:", topics);
}, (error) => {
  console.error("Unsubscribe error:", error);
});

// 5. Optional: Log out the device when the user session changes
window.plugins.indigitallLA.logOut((deviceId) => {
  console.log("Device logged out:", deviceId);
}, (error) => {
  console.error("Logout error:", error);
});