|
|
|
@ -24,7 +24,7 @@ class MinPlugin: FlutterPlugin, MethodCallHandler {
|
|
|
|
|
/// This local reference serves to register the plugin with the Flutter Engine and unregister it |
|
|
|
|
/// when the Flutter Engine is detached from the Activity |
|
|
|
|
private lateinit var channel : MethodChannel |
|
|
|
|
private lateinit var context : Context; |
|
|
|
|
private lateinit var context : Context |
|
|
|
|
|
|
|
|
|
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { |
|
|
|
|
context = flutterPluginBinding.applicationContext; |
|
|
|
@ -44,7 +44,7 @@ class MinPlugin: FlutterPlugin, MethodCallHandler {
|
|
|
|
|
.setMenuDefFontColor("#000000") |
|
|
|
|
.setMenuDefFontWeight("normal") |
|
|
|
|
.setMenuActionSheetItems(sheetItems) |
|
|
|
|
.setEnableBackground(true) |
|
|
|
|
.setEnableBackground(false) //后台运行 |
|
|
|
|
.build() |
|
|
|
|
DCUniMPSDK.getInstance().initialize(context, config) { |
|
|
|
|
result.success(it) |
|
|
|
@ -60,6 +60,7 @@ class MinPlugin: FlutterPlugin, MethodCallHandler {
|
|
|
|
|
} |
|
|
|
|
DCUniMPSDK.getInstance().setUniMPOnCloseCallBack { |
|
|
|
|
Logger.e("用户点击了退出 it: $it") |
|
|
|
|
DCUniMPSDK.getInstance().closeCurrentApp() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else if (call.method == "isInitialize") { |
|
|
|
|