@@ -605,9 +605,76 @@ import iosContinueSignInWithMFASelection from '/src/fragments/lib/auth/ios/signi
605
605
606
606
<Fragments fragments = { { swift: iosContinueSignInWithMFASelection }} />
607
607
608
- import androidContinueSignInWithMFASelection from ' /src/fragments/lib/auth/android/signin_next_steps/91_confirm_totp_mfa.mdx' ;
608
+ <InlineFilter filters = { [' android' ]} >
609
+
610
+ <BlockSwitcher >
611
+ <Block name = " Java" >
612
+
613
+ ``` java
614
+ Amplify . Auth . confirmSignIn(
615
+ MFATypeUtil . getChallengeResponse(MFAType . TOTP ),
616
+ result - > {
617
+ if (result. getNextStep(). getSignInStep() == AuthSignInStep . CONFIRM_SIGN_IN_WITH_TOTP_CODE ) {
618
+ Log . i(" AuthQuickStart" , " Received next step as confirm sign in with TOTP" );
619
+ }
620
+ // ...
621
+ },
622
+ error - > Log . e(" AuthQuickstart" , " Confirm sign in failed: " + error)
623
+ );
624
+ ```
625
+
626
+ </Block >
627
+ <Block name = " Kotlin - Callbacks" >
628
+
629
+ ``` kotlin
630
+ Amplify .Auth .confirmSignIn(
631
+ MFAType .TOTP .challengeResponse,
632
+ { result ->
633
+ if (result.nextStep.signInStep == AuthSignInStep .CONFIRM_SIGN_IN_WITH_TOTP_CODE ) {
634
+ Log .i(" AuthQuickStart" , " Received next step as confirm sign in with TOTP" );
635
+ }
636
+ // ...
637
+ },
638
+ { error -> Log .e(" AuthQuickstart" , " Confirm sign in failed: $error " ) }
639
+ )
640
+ ```
641
+
642
+ </Block >
643
+ <Block name = " Kotlin - Coroutines" >
609
644
610
- <Fragments fragments = { { android: androidContinueSignInWithMFASelection }} />
645
+ ``` kotlin
646
+ try {
647
+ val result = Amplify .Auth .confirmSignIn(MFAType .TOTP .challengeResponse)
648
+ if (result.nextStep.signInStep == AuthSignInStep .CONFIRM_SIGN_IN_WITH_TOTP_CODE ) {
649
+ Log .i(" AuthQuickStart" , " Received next step as confirm sign in with TOTP" );
650
+ }
651
+ // ...
652
+ } catch (error: Exception ) {
653
+ Log .e(" AuthQuickstart" , " Confirm sign in failed: $error " )
654
+ }
655
+ ```
656
+
657
+ </Block >
658
+ <Block name = " RxJava" >
659
+
660
+ ``` java
661
+ RxAmplify . Auth . confirmSignIn(
662
+ MFATypeUtil . getChallengeResponse(MFAType . TOTP )
663
+ ). subscribe(
664
+ result - > {
665
+ if (result. getNextStep(). getSignInStep() == AuthSignInStep . CONFIRM_SIGN_IN_WITH_TOTP_CODE ) {
666
+ Log . i(" AuthQuickStart" , " Received next step as confirm sign in with TOTP" );
667
+ }
668
+ // ...
669
+ },
670
+ error - > Log . e(" AuthQuickstart" , " Confirm sign in failed: " + error)
671
+ );
672
+ ```
673
+
674
+ </Block >
675
+ </BlockSwitcher >
676
+
677
+ </InlineFilter >
611
678
612
679
<InlineFilter filters = { [' flutter' ]} >
613
680
0 commit comments