subscribe To Activity Events
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()Content copied to clipboard
Return
A FlowSubscription to cancel the subscription.
Parameters
on Event
Called for each MemberActivityEvent emitted after subscription.
on Error
Called if collection throws (rare; the flow itself does not fail).