From 44c9e2c10d3160c31d032a06dfd5bbb988f9378d Mon Sep 17 00:00:00 2001 From: Ruben Lopez Date: Sat, 24 May 2025 10:12:48 -0300 Subject: [PATCH] Remove deprecated registrar The `registerWith` method, which used the deprecated `PluginRegistry.Registrar`, has been removed. The plugin now solely relies on `setUpChannels` for initialization. (cherry picked from commit 086daf8cabf8c2753620dfa3e5e4b34e08bf45da) --- .../src/main/kotlin/com/eopeter/flutter_dtmf/DtmfPlugin.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/android/src/main/kotlin/com/eopeter/flutter_dtmf/DtmfPlugin.kt b/android/src/main/kotlin/com/eopeter/flutter_dtmf/DtmfPlugin.kt index 3faaea6..958e022 100644 --- a/android/src/main/kotlin/com/eopeter/flutter_dtmf/DtmfPlugin.kt +++ b/android/src/main/kotlin/com/eopeter/flutter_dtmf/DtmfPlugin.kt @@ -11,7 +11,6 @@ import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel.MethodCallHandler import io.flutter.plugin.common.MethodChannel.Result -import io.flutter.plugin.common.PluginRegistry.Registrar class DtmfPlugin : FlutterPlugin, MethodCallHandler { @@ -25,10 +24,7 @@ class DtmfPlugin : FlutterPlugin, MethodCallHandler { var channel: MethodChannel? = null private lateinit var applicationContext: Context private lateinit var audioManager: AudioManager - @JvmStatic - fun registerWith(registrar: Registrar) { - setUpChannels(registrar.messenger()) - } + fun setUpChannels(messenger: BinaryMessenger) { channel = MethodChannel(messenger, "flutter_dtmf") channel?.setMethodCallHandler(DtmfPlugin())