subscribeToPushNotificationEvents method
Implementation
StreamSubscription subscribeToPushNotificationEvents(
void Function(BrazePushEvent) onEvent) {
if (_replayCallbacksConfigEnabled() && _queuedPushEvents.isNotEmpty) {
print(
"Replaying stream onEvent for previously queued Braze push events.");
_queuedPushEvents.forEach((pushEvent) => onEvent(pushEvent));
_queuedPushEvents.clear();
}
StreamSubscription subscription =
pushEventStreamController.stream.listen(onEvent);
return subscription;
}