class Teak.LiveActivity

Teak Live Activity functionality.

Static Methods

StartedLiveActivity

Report a Live Activity push-to-update token to Teak.

IEnumerator Teak.LiveActivity.StartedLiveActivity(string activityId,
                                                  byte[] pushToken,
                                                  string systemActivityId,
                                                  System.Action<Reply> callback);

Call this when a live activity starts and receives its push-to-update token, and again whenever the token rotates during the activity’s lifetime.

Parameters

Name Description

activityId

A stable, game-chosen string naming the kind of live activity (e.g. "chest_timer").

pushToken

The push-to-update token bytes from ActivityKit’s Activity.pushTokenUpdates.

systemActivityId

The OS-level per-instance activity identifier, from Activity.id.

callback

A callback invoked with the result of the call.

StartedLiveActivity

Report a Live Activity push-to-update token to Teak, using a hex-encoded token string.

IEnumerator Teak.LiveActivity.StartedLiveActivity(string activityId,
                                                  string pushTokenHex,
                                                  string systemActivityId,
                                                  System.Action<Reply> callback);

Convenience overload for callers who already hold the token as a hex string (for example, persisted via PlayerPrefs). Decodes to bytes and delegates to StartedLiveActivity(string, byte[], string, System.Action<Reply>).

Parameters

Name Description

activityId

A stable, game-chosen string naming the kind of live activity.

pushTokenHex

The push-to-update token as a hex-encoded string.

systemActivityId

The OS-level per-instance activity identifier.

callback

A callback invoked with the result of the call.

ScheduleLiveActivityUpdate

Schedule a single update to be delivered to a live activity at a future time.

IEnumerator Teak.LiveActivity.ScheduleLiveActivityUpdate(string activityId,
                                                         long offset,
                                                         Dictionary<string, object> customData,
                                                         Dictionary<string, object> systemData,
                                                         System.Action<Reply> callback);

Call between StartedLiveActivity(string, byte[], string, System.Action<Reply>) and the activity ending. customData is delivered as APNs content-state; systemData carries Apple system fields (event, stale-date, dismissal-date).

Parameters

Name Description

activityId

A stable, game-chosen string naming the kind of live activity.

offset

Delay from server-now, in seconds, at which the update should be delivered.

customData

Game-defined content-state payload. Must contain only JSON-serializable values. Required.

systemData

Optional Apple system fields. May be null.

callback

A callback invoked with the result of the call.

CancelLiveActivityUpdates

Cancel all pending scheduled updates for a live activity.

IEnumerator Teak.LiveActivity.CancelLiveActivityUpdates(string activityId,
                                                        System.Action<Reply> callback);

Scopes to the current user’s updates for activityId ; updates scheduled for other users or other activity kinds are unaffected.The reply’s Reply.CanceledCount carries the number of updates canceled by the server on success.

Parameters

Name Description

activityId

A stable, game-chosen string naming the kind of live activity whose pending updates should be canceled.

callback

A callback invoked with the result of the call.