Skip to content

Commit 0c3ccc7

Browse files
update examples
1 parent 43f7ff1 commit 0c3ccc7

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

android-aggregate-verifier-example/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencies {
3838
implementation 'com.google.android.material:material:1.6.1'
3939
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
4040
implementation 'com.google.code.gson:gson:2.9.1'
41-
implementation 'com.github.grvgoel81:web3auth-android-sdk:3.0.0.2'
41+
implementation 'com.github.grvgoel81:web3auth-android-sdk:4.0.0.4'
4242
implementation 'org.web3j:core:4.8.7-android'
4343
testImplementation 'junit:junit:4.13.2'
4444
androidTestImplementation 'androidx.test.ext:junit:1.1.3'

android-aggregate-verifier-example/app/src/main/java/com/sbz/web3authdemoapp/MainActivity.kt

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ class MainActivity : AppCompatActivity() {
4848
val authConnectionConfig = ArrayList<AuthConnectionConfig>()
4949
authConnectionConfig.add(
5050
AuthConnectionConfig(
51-
authConnectionId = "w3a-google",
52-
groupedAuthConnectionId = "aggregate-sapphire",
51+
authConnectionId = "w3a-google-mobile",
52+
groupedAuthConnectionId = "aggregate-mobile",
5353
authConnection = AuthConnection.GOOGLE,
5454
clientId = getString(R.string.web3auth_google_client_id),
5555
)
5656
)
5757

5858
authConnectionConfig.add(
5959
AuthConnectionConfig(
60-
authConnectionId = "w3a-a0-email-passwordless",
61-
groupedAuthConnectionId = "aggregate-sapphire",
60+
authConnectionId = "w3a-a0-email-passwordless-mobile",
61+
groupedAuthConnectionId = "aggregate-mobile",
6262
authConnection = AuthConnection.CUSTOM,
6363
clientId = getString(R.string.web3auth_auth0_client_id),
6464
)
@@ -67,10 +67,10 @@ class MainActivity : AppCompatActivity() {
6767
web3Auth = Web3Auth(
6868
Web3AuthOptions(
6969
clientId = getString(R.string.web3auth_project_id), // pass over your Web3Auth Client ID from Developer Dashboard
70-
web3AuthNetwork = Web3AuthNetwork.SAPPHIRE_MAINNET, // pass over the network you want to use (MAINNET or TESTNET or CYAN, AQUA, SAPPHIRE_MAINNET or SAPPHIRE_TESTNET)
71-
authBuildEnv = BuildEnv.PRODUCTION,
70+
web3AuthNetwork = Web3AuthNetwork.SAPPHIRE_DEVNET, // pass over the network you want to use (MAINNET or TESTNET or CYAN, AQUA, SAPPHIRE_MAINNET or SAPPHIRE_TESTNET)
71+
authBuildEnv = BuildEnv.TESTING,
7272
redirectUrl = "com.sbz.web3authdemoapp://auth", // your app's redirect URL
73-
authConnectionConfig = ArrayList<AuthConnectionConfig>()
73+
// authConnectionConfig = authConnectionConfig
7474
), context = this
7575

7676
)
@@ -151,12 +151,10 @@ class MainActivity : AppCompatActivity() {
151151
val loginCompletableFuture: CompletableFuture<Web3AuthResponse> = web3Auth.connectTo(
152152
LoginParams(
153153
selectedLoginProvider,
154-
authConnectionId = "w3a-a0-email-passwordless",
155-
groupedAuthConnectionId = "aggregate-sapphire",
154+
authConnectionId = "w3a-a0-email-passwordless-mobile",
155+
groupedAuthConnectionId = "aggregate-mobile",
156156
extraLoginOptions = ExtraLoginOptions(
157-
domain = "https://web3auth.au.auth0.com",
158-
userIdField = "email",
159-
isUserIdCaseSensitive = false
157+
domain = "https://web3auth.au.auth0.com"
160158
)
161159
)
162160
)
@@ -174,7 +172,7 @@ class MainActivity : AppCompatActivity() {
174172
private fun signInGoogle() {
175173
val selectedLoginProvider = AuthConnection.GOOGLE
176174
val loginCompletableFuture: CompletableFuture<Web3AuthResponse> =
177-
web3Auth.connectTo(LoginParams(selectedLoginProvider, authConnectionId = "w3a-google", groupedAuthConnectionId = "aggregate-sapphire"))
175+
web3Auth.connectTo(LoginParams(selectedLoginProvider, authConnectionId = "w3a-google-mobile", groupedAuthConnectionId = "aggregate-mobile"))
178176

179177
loginCompletableFuture.whenComplete { _, error ->
180178
if (error == null) {
@@ -188,7 +186,7 @@ class MainActivity : AppCompatActivity() {
188186

189187
private fun enableMFA() {
190188
val loginParams = prepareLoginParams()
191-
val completableFuture = web3Auth.enableMFA(loginParams)
189+
val completableFuture = web3Auth.enableMFA()
192190
completableFuture.whenComplete{_, error ->
193191
if (error == null) {
194192
Log.d("MainActivity_Web3Auth", "Launched successfully")
@@ -202,13 +200,14 @@ class MainActivity : AppCompatActivity() {
202200

203201
private fun prepareLoginParams(): LoginParams {
204202
val loginParams = if(web3Auth.getUserInfo()!!.authConnection == AuthConnection.GOOGLE.name) {
205-
LoginParams(AuthConnection.GOOGLE)
203+
LoginParams(AuthConnection.GOOGLE, authConnectionId = "w3a-google-mobile", groupedAuthConnectionId = "aggregate-mobile")
206204
} else {
207205
LoginParams(
208206
AuthConnection.CUSTOM,
207+
authConnectionId = "w3a-a0-email-passwordless-mobile",
208+
groupedAuthConnectionId = "aggregate-mobile",
209209
extraLoginOptions = ExtraLoginOptions(
210210
domain = "https://web3auth.au.auth0.com",
211-
userIdField = "email",
212211
isUserIdCaseSensitive = false
213212
)
214213
)

android-aggregate-verifier-example/app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<resources>
22
<string name="app_name">Web3Auth Android Aggregate Verifier Example</string>
3-
<string name="web3auth_project_id">BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ</string>
3+
<string name="web3auth_project_id">BJFT2n2Nc-2HY9yJCacDygMvuJQc8do8bF7GMWig2KiZgJJ5ks-Hiw_JvcJvqiJ5yYTkRptfwoeQFkqJZAG65do</string>
44
<string name="web3auth_auth0_client_id">QiEf8qZ9IoasbZsbHvjKZku4LdnRC1Ct</string>
55
<string name="web3auth_google_client_id">519228911939-cri01h55lsjbsia1k7ll6qpalrus75ps.apps.googleusercontent.com</string>
66
<string name="web3auth_android_demo">Web3Auth Android Aggregate Verifier Demo</string>

0 commit comments

Comments
 (0)