---
updatedAt: 2026-09-04T07:13:27.000Z
agentTools:
  projectIndex: https://documentation.indigitall.com/llms.txt
---

# iOS

This guide explains how to work with Live Activities using our SDK, from retrieving active activities to managing push tokens.

## Get Active Live Activities

To retrieve a list of currently active Live Activities associated with the device:

```swift
var la = new IndigitallLiveActivity();

la.GetListLiveActivities(
    onSuccess: liveActivities =>
    {
        Console.WriteLine("List of enabled live activities:");
        foreach (var item in liveActivities)
        {
            Console.WriteLine($"ID: {item.LiveActivityId}, ChannelId: {item.iOSChannelId}");
        }
    },
    onError: (code, message) =>
    {
        Console.WriteLine($"Error fetching live activities [{code}]: {message}");
    }
);
```

## Register Device Information

Send the list of Live Activities the device is subscribed to so the backend can associate them with the device for push updates:

```swift
LiveActivity[] liveActivitiesToRegister = ...; 

la.SubscribeToLiveActivities(
    liveActivitiesToRegister,
    onSuccess: () =>
    {
        Console.WriteLine("Successfully registered live activities with device");
    },
    onError: (code, message) =>
    {
        Console.WriteLine($"Failed to register live activities [{code}]: {message}");
    }
);

```

## Request and Register Push Token (PushToStart)

To receive push notifications for Live Activities, you need to listen for token updates and register them.\
This example uses a custom *TimerWidgetAttributes* type:

```swift
string token = "..."; // 
string iosAttributesType = "TimerWidgetAttributes";

la.SetPushToStartTokenUpdates(
    token,
    iosAttributesType,
    onSuccess: () =>
    {
        Console.WriteLine("PushToStart token sent successfully");
    },
    onError: (code, message) =>
    {
        Console.WriteLine($"Error sending PushToStart token [{code}]: {message}");
    }
);

```

> 📘 This token should be sent to your backend notification server so it can target the correct Live Activity.

## Monitor Token Updates (Advanced – Rarely Needed)

In most cases, tokens won't change during the activity's lifecycle. However, you can monitor token updates with:

```swift
string updatedToken = "..."; 
string liveActivityExternalId = "YOUR_LIVE_ACTIVITY_EXTERNAL_ID";

la.SetPushTokenUpdates(
    updatedToken,
    liveActivityExternalId,
    onSuccess: () =>
    {
        Console.WriteLine("Token update sent successfully");
    },
    onError: (code, message) =>
    {
        Console.WriteLine($"Error updating token [{code}]: {message}");
    }
);

```

> 📘 Typically, this isn’t necessary if you’re sending push notifications via a known *channelId*, since tokens are expected to remain stable.