Skip to content

Commit be84f0a

Browse files
committed
feat: update sfa android v10 testing
Signed-off-by: Gaurav Goel <[email protected]>
1 parent dfe6110 commit be84f0a

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

single-factor-auth-android/sfa-android-quick-start/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ android {
4040

4141
dependencies {
4242
// IMP START - Installation
43-
implementation 'com.github.grvgoel81:web3auth-android-sdk:1.0.0.7'
43+
implementation 'com.github.grvgoel81:web3auth-android-sdk:2.0.0.1'
4444
implementation 'org.web3j:core:4.8.8-android'
4545
// IMP END - Installation
4646
implementation platform('com.google.firebase:firebase-bom:31.0.2')

single-factor-auth-android/sfa-android-quick-start/app/src/main/java/com/example/androidsfaexample/MainActivity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class MainActivity : AppCompatActivity() {
5555
web3AuthNetwork = Web3AuthNetwork.SAPPHIRE_MAINNET,
5656
authBuildEnv = BuildEnv.TESTING,
5757
defaultChainId = "0x1",
58+
sessionNamespace = "sfa",
5859
redirectUrl = "w3a://com.example.androidsfaexample"
5960
)
6061

single-factor-auth-flutter/sfa_flutter_quick_start/lib/core/web3auth_sfa.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ class Web3AuthSFA {
3838
}
3939
}
4040

41+
Future<void> connected() async {
42+
try {
43+
final isConnected = await singleFactorAuthFlutter.connected();
44+
log('isConnected: $isConnected');
45+
final isConnected_1 = await singleFactorAuthFlutter.connected();
46+
log('isConnected_1: $isConnected_1');
47+
} catch (e) {
48+
log("Error connecting SFA: $e");
49+
}
50+
}
51+
4152
Future<void> showWalletUI() async {
4253
try {
4354
final chainConfig = ChainConfig(

single-factor-auth-flutter/sfa_flutter_quick_start/lib/home_page.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ class _HomePageState extends State<HomePage> {
105105
},
106106
child: const Text('Show Transaction UI'),
107107
),
108+
ElevatedButton(
109+
onPressed: () {
110+
web3authSFA.connected();
111+
},
112+
child: const Text('isConnected State'),
113+
),
108114
ElevatedButton(
109115
onPressed: () {
110116
// Use the AuthService class to handle sign out

0 commit comments

Comments
 (0)