I managed to debug the problem and the directions from region are doubles instead of int.
Foundation/NSNumber.swift:384: Fatal error: Unable to bridge NSNumber to Int
let region = call.getObject("region")
self.scanRegion = ScanRegion()
self.scanRegion.top = region?["top"] as! Int
I temporarily fix it like this:
if let region = call.getObject("region") as? [String: Any] {
self.scanRegion = ScanRegion()
self.scanRegion.top = Int(region["top"] as? Double ?? 0.0)
self.scanRegion.right = Int(region["right"] as? Double ?? 0.0)
self.scanRegion.left = Int(region["left"] as? Double ?? 0.0)
self.scanRegion.bottom = Int(region["bottom"] as? Double ?? 0.0)
self.scanRegion.measuredByPercentage = Int(region["measuredByPercentage"] as? Double ?? 0.0)
}
I managed to debug the problem and the directions from region are doubles instead of int.
Foundation/NSNumber.swift:384: Fatal error: Unable to bridge NSNumber to Int
I temporarily fix it like this: