Skip to content

Commit

Permalink
Merge pull request mintware-de#123 from mjafartp/master
Browse files Browse the repository at this point in the history
App Crash with Background fetch plugin cleared
  • Loading branch information
matthewtsmith authored Jun 11, 2019
2 parents 59e20c1 + f7b09a9 commit 18960bd
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit 18960bd

Please sign in to comment.