CleverPush Developer Docs

CleverPush Developer Docs

  • SDK Docs
  • API Overview
  • API Reference

›iOS SDK

JavaScript SDK

  • Setup
  • Methods

iOS SDK

  • Setup
  • Methods
  • Inbox View
  • Chat
  • Stories
  • Deep Links
  • Live Activities
  • Troubleshooting
  • Changelog

Android SDK

  • Setup
  • Methods
  • Notification Service Extension
  • Inbox View
  • Chat
  • Stories
  • Deep Links
  • Troubleshooting
  • Upgrading
  • Geo Fence Location Permission
  • Changelog

Capacitor SDK

  • Setup
  • Methods
  • Changelog

Cordova SDK

  • Setup
  • Methods
  • Changelog

React Native SDK

  • Setup
  • Methods
  • Changelog

Xamarin SDK

  • Setup
  • Methods
  • Changelog

Flutter SDK

  • Setup
  • Methods
  • Chat
  • Troubleshooting
  • Changelog

Live Activities

Introduction

  • WWDC22 introduced a Live Activities API in iOS 16. With it, we can live to update a notification instead of sending multiple notifications.
  • Live Activity is a new feature that helps users stay on top of things that are happening in real-time, such as a sports game, workout, ride-share, or food delivery order, right from the Lock Screen.
  • Live Activities can be used in the below type of categories applications
    • Sports - Real-time scores, match, and player statistics
    • News - Breaking news
    • Fitness - Walk, run statistics during your workout or walk
    • Deliveries - Running delivery status, running order status
    • Entertainment - Live concert updates
    • Travel - Flight, booking updates

Get started

Step 1: Add a live activity widget extension to the ios project

File > New > Target

Import activities

Step 2: Select target as a widget extension

Target > Widget Extension

Select extension type

Step 3: Include live activity

  • Enter the widget extension name, and also select the checkmark of Include Live Activity because without selecting that widget extension will not be added.

Select extension type

Step 4: Enable Supports Live Activities

  • Go to the info.plist in the project add the key Supports Live Activities and set it to Yes

Select extension type

Step 5: Displaying live data with Live Activities

  • Apple’s Guideline for creating live Activity

Step 6: Create your live Activity

  • Import CleverPush and ActivityKit into your view controller
Swift
import CleverPush
import ActivityKit

Step 7: Enter the below code to start a Live Activity and register your activity_id with Cleverpush.

  • After registering live activity they will return the live Activity id and activity push token.
  • We must have to pass the activity.id and activity.token to the CleverPush.startLiveActivity method for sending updates or ending the activity
Swift
import ActivityKit
import CleverPush

class ViewController: UIViewController {
func startLiveActivity() {
let attributes = CleverPushWidgetExtensionAttributes(title: "CleverPush")
let contentState = CleverPushWidgetExtensionAttributes.LiveDeliveryData(message: "Live Activity Stared")
do {
let activity = try Activity<CleverPushWidgetExtensionAttributes>.request(
attributes: attributes,
contentState: contentState,
pushType: .token)
Task {
for await data in activity.pushTokenUpdates {
let myToken = data.map {String(format: "%02x", $0)}.joined()
[CleverPush startLiveActivity:activity.id pushToken:actvityToken];
}
}
} catch (let error) {
print(error.localizedDescription)
}
}
}

Live Activity API reference

How to send live activity updates

← Deep LinksTroubleshooting →
  • Step 1: Add a live activity widget extension to the ios project
  • Step 2: Select target as a widget extension
  • Step 3: Include live activity
  • Step 4: Enable Supports Live Activities
  • Step 5: Displaying live data with Live Activities
  • Step 6: Create your live Activity
  • Step 7: Enter the below code to start a Live Activity and register your activity_id with Cleverpush.
  • Live Activity API reference
SDKs
JavaScriptiOSAndroidCordovaCapacitorReact NativeXamarinFlutter
Community
TwitterFacebookGitHub
More
API ReferenceAPI OverviewBlogImprintPrivacy PolicyTerms of serviceGDPR
Copyright © 2025 CleverPush