startFeature method
當 needConfirm 為 true 且 isResultPageDisplayable 為 false 時, 需要在收到結果後手動調用 confirmScanResult 方法來確認結果
Implementation
Future<void> startFeature(String accessToken, AuthmeFeature feature, {
int requestCode = 1001,
bool needConfirm = true,
bool isResultPageDisplayable = true,
bool isResultEditable = true,
bool isFraudIntroEnable = true,
}) async {
try {
await _channel.invokeMethod('startFeature', {
'token': accessToken,
'feature': feature.rawValue,
'requestCode': requestCode,
'config': {
'needConfirm': needConfirm,
'isResultPageDisplayable': isResultPageDisplayable,
'isResultEditable': isResultEditable,
'isFraudIntroEnable': isFraudIntroEnable,
}
});
} on PlatformException catch (e) {
log("Failed to start feature: ${e.message}");
rethrow;
}
}