@@ -13,6 +13,7 @@ import 'dart:io';
1313import 'package:flutter/services.dart' ;
1414import 'package:reflex/src/helper/events/notification_event.dart' ;
1515import 'package:reflex/src/helper/exception/reflex_exception.dart' ;
16+ import 'package:reflex/src/helper/helper.dart' ;
1617import 'package:reflex/src/platform/reflex_platform.dart' ;
1718
1819class ReflexHandler extends ReflexPlatform {
@@ -25,13 +26,28 @@ class ReflexHandler extends ReflexPlatform {
2526
2627 Stream <NotificationEvent >? _notificationStream;
2728
29+ late final List <dynamic > arguments;
30+
31+ @override
32+ void init ({
33+ required bool debug,
34+ AutoReply ? autoReply,
35+ }) {
36+ Map <String , dynamic > map = {
37+ "debug" : debug,
38+ "autoReply" : autoReply? .deserialize (),
39+ };
40+ arguments = [map];
41+ }
42+
2843 @override
2944 Stream <NotificationEvent >? get notificationStream {
3045 if (Platform .isAndroid) {
31- _notificationStream ?? =
32- _eventChannel.receiveBroadcastStream ().map <NotificationEvent >(
33- (event) => NotificationEvent .getNotificationEventFromMap (event),
34- );
46+ _notificationStream ?? = _eventChannel
47+ .receiveBroadcastStream (arguments)
48+ .map <NotificationEvent >(
49+ (event) => NotificationEvent .getNotificationEventFromMap (event),
50+ );
3551 return _notificationStream;
3652 }
3753 throw ReflexException ('notificationStream is only supported on Android!' );
0 commit comments