Skip to content

Commit f024838

Browse files
committed
feat: update android ask version
Signed-off-by: Gaurav Goel <[email protected]>
1 parent 308eb43 commit f024838

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

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.grvgoel81:web3auth-android-sdk:0.0.0.2'
40+
implementation 'com.github.grvgoel81:web3auth-android-sdk:0.0.0.5'
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: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ class MainActivity : AppCompatActivity() {
9797
sessionResponse.whenComplete { _, error ->
9898
if (error == null) {
9999
reRender()
100-
println("PrivKey: " + web3Auth.getPrivkey())
101-
println("ed25519PrivKey: " + web3Auth.getEd25519PrivKey())
100+
println("PrivKey: " + web3Auth.getPrivateKey())
101+
println("ed25519PrivKey: " + web3Auth.getEd25519PrivateKey())
102102
println("Web3Auth UserInfo" + web3Auth.getUserInfo())
103-
credentials = Credentials.create(web3Auth.getPrivkey())
103+
credentials = Credentials.create(web3Auth.getPrivateKey())
104104

105105
} else {
106106
Log.d("MainActivity_Web3Auth", error.message ?: "Something went wrong")
@@ -174,14 +174,14 @@ class MainActivity : AppCompatActivity() {
174174
extraLoginOptions = ExtraLoginOptions(
175175
domain = "firebase",
176176
id_token = idToken,
177-
verifierIdField = "sub"
177+
userIdField = "sub"
178178
)
179179
)
180180
val loginCompletableFuture: CompletableFuture<Web3AuthResponse> = web3Auth.login(loginParams)
181181

182182
loginCompletableFuture.whenComplete { _, error ->
183183
if (error == null) {
184-
credentials = Credentials.create(web3Auth.getPrivkey())
184+
credentials = Credentials.create(web3Auth.getPrivateKey())
185185
reRender()
186186
} else {
187187
Log.d("MainActivity_Web3Auth", error.message ?: "Something went wrong" )
@@ -230,7 +230,14 @@ class MainActivity : AppCompatActivity() {
230230

231231
private fun prepareLoginParams(result: GetTokenResult): LoginParams {
232232
val authConnection = AuthConnection.CUSTOM
233-
return LoginParams(authConnection, extraLoginOptions = ExtraLoginOptions(domain= "firebase", id_token = result.token, verifierIdField = "sub"))
233+
return LoginParams(
234+
authConnection,
235+
extraLoginOptions = ExtraLoginOptions(
236+
domain = "firebase",
237+
id_token = result.token,
238+
userIdField = "sub"
239+
)
240+
)
234241
}
235242

236243
private fun launchWalletServices() {
@@ -338,7 +345,7 @@ class MainActivity : AppCompatActivity() {
338345
var key: String? = null
339346
var userInfo: UserInfo? = null
340347
try {
341-
key = web3Auth.getPrivkey()
348+
key = web3Auth.getPrivateKey()
342349
userInfo = web3Auth.getUserInfo()
343350
} catch (ex: Exception) {
344351
print(ex)

0 commit comments

Comments
 (0)