File tree Expand file tree Collapse file tree 4 files changed +13
-6
lines changed
core/src/main/java/com/web3auth/core Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import android.content.pm.PackageManager
66import android.net.Uri
77import android.util.Base64
88import android.util.Patterns
9- import android.widget.Toast
109import androidx.browser.customtabs.CustomTabsService
1110
1211const val BASE64_URL_FLAGS = Base64 .URL_SAFE or Base64 .NO_WRAP or Base64 .NO_PADDING
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions) {
7474 initiateKeyStoreManager()
7575
7676 // authorize session
77- if (ApiHelper .isNetworkAvailable(context)) {
77+ if (ApiHelper .isNetworkAvailable(context)) {
7878 authorizeSession()
7979 }
8080 }
@@ -183,7 +183,7 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions) {
183183 }
184184
185185 fun logout (params : Map <String , Any >? = null): CompletableFuture <Void > {
186- if (ApiHelper .isNetworkAvailable(context)) {
186+ if (ApiHelper .isNetworkAvailable(context)) {
187187 sessionTimeOutAPI()
188188 }
189189 request(" logout" , extraParams = params)
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ object ApiHelper {
1818
1919 private val okHttpClient = OkHttpClient ().newBuilder()
2020 .readTimeout(60 , TimeUnit .SECONDS )
21- .connectTimeout(60 , TimeUnit .SECONDS )
21+ .connectTimeout(20 , TimeUnit .SECONDS )
2222 .addInterceptor(HttpLoggingInterceptor ().apply {
2323 if (BuildConfig .DEBUG ) {
2424 level = HttpLoggingInterceptor .Level .BODY
@@ -37,9 +37,11 @@ object ApiHelper {
3737
3838 fun isNetworkAvailable (context : Context ? ): Boolean {
3939 if (context == null ) return false
40- val connectivityManager = context.getSystemService(Context .CONNECTIVITY_SERVICE ) as ConnectivityManager
40+ val connectivityManager =
41+ context.getSystemService(Context .CONNECTIVITY_SERVICE ) as ConnectivityManager
4142 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .Q ) {
42- val capabilities = connectivityManager.getNetworkCapabilities(connectivityManager.activeNetwork)
43+ val capabilities =
44+ connectivityManager.getNetworkCapabilities(connectivityManager.activeNetwork)
4345 if (capabilities != null ) {
4446 when {
4547 capabilities.hasTransport(NetworkCapabilities .TRANSPORT_CELLULAR ) -> {
You can’t perform that action at this time.
0 commit comments