mirror of
https://github.com/simplezhli/flutter_barcode_reader.git
synced 2024-11-15 01:19:23 +08:00
Merge pull request #123 from mjafartp/master
App Crash with Background fetch plugin cleared
This commit is contained in:
commit
18960bd493
@ -16,9 +16,11 @@ class BarcodeScanPlugin(val activity: Activity): MethodCallHandler,
|
||||
@JvmStatic
|
||||
fun registerWith(registrar: Registrar): Unit {
|
||||
val channel = MethodChannel(registrar.messenger(), "com.apptreesoftware.barcode_scan")
|
||||
val plugin = BarcodeScanPlugin(registrar.activity())
|
||||
channel.setMethodCallHandler(plugin)
|
||||
registrar.addActivityResultListener(plugin)
|
||||
if (registrar.activity() != null) {
|
||||
val plugin = BarcodeScanPlugin(registrar.activity())
|
||||
channel.setMethodCallHandler(plugin)
|
||||
registrar.addActivityResultListener(plugin)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user