アプリ間でバインディングを有効化
最終更新
役に立ちましたか?
役に立ちましたか?
@Override
public void onIssuerAuthenticationRequired(IDVSession idvSession) {
// APP_TO_APP の ID&V 方法を送信
for (IDVMethod idvMethod : idvSession.getIdvMethods()) {
if (idvMethod.getType().equals(IDVType.APP_TO_APP)) {
idvSession.selectIdvMethod(idvMethod);
}
}
}
@Override
public void onIssuerAuthenticationReady(IDVSession idvSession,
@Nullable OtpActivationStatus status) {
}
@Override
public void onError(TMGClientException exception) {
// エラーがあるか確認する
int errorCode = exception.getErrorCode();
int errorMessage = exception.getMessage();
}guard let idvSession = VisaService.shared.idvSession else {
// IDVセッションがありません。
return
}
// 1. IDV方法の一覧を表示します。
do {
let idvMethods = try idvSession.idvMethods
let selectedIdvMethod = idvMethods[0] // ユーザーがアプリ間IDV方法を選択する
// 2. IDV方法を送信します。
idvSession.selectIDVMethod(selectedIdvMethod) { (result) in
if let otpActivationStatus = result {
} else {
if selectedIdvMethod.type == .appToApp {
let idvType = selectedIdvMethod.type
let requestPayload = selectedIdvMethod.requestPayload
let source = selectedIdvMethod.source
let value = selectedIdvMethod.value
// 3. アプリを起動します。
}
}
}
} catch let error {
// エラーを処理します。
}
// 4. ステップ2(selectIDVMethod)の失敗は completionHandler で処理されます。
VisaService.shared.completionHandler = { (session, error) in
// 5. それが selectIDVMethod のエラーか確認します。
if let session = session,
let error = error,
error.description == TMGError.invalidIdvMethod.description {
VisaService.shared.idvSession = session
// 6. IDVフローを再試行します。
}
}// アプリ間用の追加データを取得します。
IDVType idvType = idvMethod.getType();
String requestPayload = idvMethod.getRequestPayload();
String source = idvMethod.getSource();
String value = idvMethod.getValue();let idvType = selectedIdvMethod.type
let requestPayload = selectedIdvMethod.requestPayload
let source = selectedIdvMethod.source
let value = selectedIdvMethod.value@Override
public void onIssuerAuthenticationReady(IDVSession idvSession,
@Nullable OtpActivationStatus status) {
// ローカルでバインディングを有効化する
idvSession.activateBinding(null);
}
@Override
public void onError(TMGClientException exception) {
// エラーがないか確認する
int errorCode = exception.getErrorCode();
int errorMessage = exception.getMessage();
}guard let idvSession = VisaService.shared.idvSession else {
// IDVセッションがありません。
return
}
// 1. エンドユーザーがアプリから戻った後に activate を呼び出す
idvSession.activateBinding(withValue: nil)
VisaService.shared.completionHandler = { (session, error) in
// 2. activateBinding が成功したか確認する。
if error == nil {
}
}