initNotificationCallBack method
Implementation
@override
Future<void> initNotificationCallBack(OnTapNotification? callback) async {
tapCallBack = callback;
methodChannel.setMethodCallHandler((MethodCall call) async {
print("callled ${call.method} ${call.arguments}");
final Map<String, dynamic> payload =
json.decode(call.arguments["launch"]);
final NotificationMessage msg = NotificationMessage.fromJson(payload);
EventType type =
EventType.values.firstWhere((element) => element.name == call.method);
final details = NotificationCallBackDetails(
argrument: call.arguments["arguments"],
eventType: type,
message: msg,
userInput:
Map<String, dynamic>.from(call.arguments["user_input"] ?? {}));
tapCallBack?.call(details);
});
}