Skip to content

Commit cbf5fc6

Browse files
update examples
1 parent fbf76c3 commit cbf5fc6

File tree

18 files changed

+39
-22
lines changed

18 files changed

+39
-22
lines changed

android/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.web3auth:web3auth-android-sdk:9.0.0'
41+
implementation 'com.github.web3auth:web3auth-android-sdk:9.0.1'
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/android-auth0-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.web3auth:web3auth-android-sdk:9.0.0'
41+
implementation 'com.github.web3auth:web3auth-android-sdk:9.0.1'
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/android-firebase-example/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ dependencies {
3737
implementation 'com.google.android.material:material:1.7.0'
3838
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
3939
implementation 'com.google.code.gson:gson:2.9.1'
40-
implementation 'com.github.web3auth:web3auth-android-sdk:9.0.0'
40+
implementation 'com.github.web3auth:web3auth-android-sdk:9.0.1'
4141
implementation 'org.web3j:core:4.8.7-android'
4242
implementation platform('com.google.firebase:firebase-bom:31.0.2')
4343
implementation 'com.google.firebase:firebase-auth-ktx'

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import com.google.firebase.auth.GetTokenResult
1616
import com.google.firebase.auth.ktx.auth
1717
import com.google.firebase.ktx.Firebase
1818
import com.google.gson.Gson
19+
import com.google.gson.JsonArray
1920
import com.web3auth.core.Web3Auth
2021
import com.web3auth.core.types.*
2122
import org.web3j.crypto.Credentials

android/android-playground/app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ dependencies {
5757
implementation("com.google.accompanist:accompanist-pager:0.13.0")
5858
implementation("com.google.accompanist:accompanist-pager-indicators:0.27.1")
5959
implementation("androidx.compose.material:material-icons-extended:1.6.7")
60-
implementation("com.github.web3auth:web3auth-android-sdk:9.0.0")
60+
implementation("com.github.web3auth:web3auth-android-sdk:9.0.1")
6161
debugImplementation("androidx.compose.ui:ui-tooling:1.6.7")
6262
implementation("androidx.compose.ui:ui-tooling-preview:1.6.7")
6363
implementation("androidx.activity:activity-compose:1.9.0")

android/android-playground/app/src/main/java/com/example/android_playground/MainActivity.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class MainActivity : ComponentActivity() {
2929
modules(appModule)
3030
}
3131

32-
viewModel.setResultUrl(intent?.data)
33-
3432
setContent {
3533
AndroidplaygroundTheme {
3634
// A surface container using the 'background' color from the theme
@@ -43,6 +41,7 @@ class MainActivity : ComponentActivity() {
4341
}
4442
}
4543
viewModel.initialise()
44+
viewModel.setResultUrl(intent?.data)
4645
}
4746
}
4847

android/android-playground/app/src/main/java/com/example/android_playground/data/Web3AuthHelperImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Web3AuthHelperImpl(
3131
}
3232

3333
override suspend fun initialize(): CompletableFuture<Void> {
34-
return web3Auth.initialize()
34+
return web3Auth.initialize()
3535
}
3636

3737
override suspend fun setResultUrl(uri: Uri?) {

android/android-playground/app/src/main/java/com/example/android_playground/di/appModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private fun getWeb3AuthHelper(context: Context): Web3AuthHelper {
3333
clientId = "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ",
3434
network = Network.SAPPHIRE_MAINNET,
3535
redirectUrl = Uri.parse( "w3a://com.example.android_playground/auth")
36-
), context
36+
), context.applicationContext
3737
)
3838

3939
return Web3AuthHelperImpl(web3Auth)

android/android-playground/app/src/main/java/com/example/android_playground/viewmodel/MainViewModel.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ class MainViewModel(private val web3AuthHelper: Web3AuthHelper) : ViewModel() {
8484

8585
fun initialise() {
8686
viewModelScope.launch {
87-
web3AuthHelper.initialize().await()
87+
try {
88+
web3AuthHelper.initialize().await()
89+
}catch (e: Exception) {
90+
Log.e("Initialize", e.toString())
91+
}
8892
isUserLoggedIn()
8993
}
9094
}
@@ -122,9 +126,9 @@ class MainViewModel(private val web3AuthHelper: Web3AuthHelper) : ViewModel() {
122126
viewModelScope.launch {
123127
try {
124128
web3AuthHelper.logOut().await()
125-
_isLoggedIn.emit(true)
126-
} catch (e: Exception) {
127129
_isLoggedIn.emit(false)
130+
} catch (e: Exception) {
131+
_isLoggedIn.emit(true)
128132
}
129133
}
130134
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id("com.android.application") version "8.7.2" apply false
3+
id("com.android.application") version "8.2.0" apply false
44
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
55
}

0 commit comments

Comments
 (0)