diff --git a/lib/extensions/method_channel_extensions.dart b/lib/extensions/method_channel_extensions.dart index a8f5c42..1f34531 100644 --- a/lib/extensions/method_channel_extensions.dart +++ b/lib/extensions/method_channel_extensions.dart @@ -5,7 +5,7 @@ extension CustomerIOMethodChannelExtensions on MethodChannel { /// Invokes a native method and returns the result. /// Logs exceptions internally without propagating them. Future invokeNativeMethod(String method, - {Map arguments = const {}}) async { + [Map arguments = const {}]) async { try { return await invokeMethod(method, arguments); } on PlatformException catch (ex) { @@ -28,6 +28,6 @@ extension CustomerIOMethodChannelExtensions on MethodChannel { /// Simplifies invoking a native method that doesn't return a value. Future invokeNativeMethodVoid(String method, [Map arguments = const {}]) async { - return await invokeNativeMethod(method, arguments: arguments); + return await invokeNativeMethod(method, arguments); } } diff --git a/lib/messaging_push/method_channel.dart b/lib/messaging_push/method_channel.dart index e322da5..cfc526a 100644 --- a/lib/messaging_push/method_channel.dart +++ b/lib/messaging_push/method_channel.dart @@ -1,9 +1,9 @@ import 'dart:io'; -import 'package:customer_io/extensions/method_channel_extensions.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; +import '../extensions/method_channel_extensions.dart'; import '_native_constants.dart'; import 'platform_interface.dart'; @@ -33,7 +33,7 @@ class CustomerIOMessagingPushMethodChannel } return methodChannel - .invokeNativeMethod(NativeMethods.onMessageReceived, arguments: { + .invokeNativeMethod(NativeMethods.onMessageReceived, { NativeMethodParams.message: message, NativeMethodParams.handleNotificationTrigger: handleNotificationTrigger, }).then((handled) => handled == true);