Skip to content

Commit

Permalink
App Crash with Background fetch plugin cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
mjafartp authored Jun 8, 2019
1 parent 8455f15 commit f7b09a9
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 f7b09a9

Please sign in to comment.