subscribeToActivityEvents

abstract fun subscribeToActivityEvents(onEvent: (MemberActivityEvent) -> Unit, onError: (Throwable) -> Unit = {}): FlowSubscription

Swift-friendly callback wrapper around activityEvents. Call FlowSubscription.close to stop receiving events.

Swift

let sub = AFCore.shared.activities().subscribeToActivityEvents(
onEvent: { event in self.refreshVisibleMonth() },
onError: { error in print("Error: \(error)") }
)
// Later, in deinit / viewDidDisappear:
sub.close()

Return

A FlowSubscription to cancel the subscription.

Parameters

onEvent

Called for each MemberActivityEvent emitted after subscription.

onError

Called if collection throws (rare; the flow itself does not fail).