-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Update android SDK #2295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update android SDK #2295
Changes from all commits
2942631
9f32e7d
313073e
74d2700
ae4c3ab
fa60e76
ba28ca9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,14 +16,15 @@ When setting up Web3Auth, you'll pass in the options to the constructor. This co | |
| ```kotlin | ||
| import com.web3auth.core.Web3Auth | ||
| import com.web3auth.core.types.Web3AuthOptions | ||
| import org.torusresearch.fetchnodedetails.types.Web3AuthNetwork | ||
|
|
||
| // focus-start | ||
| var web3Auth = Web3Auth( | ||
| Web3AuthOptions( | ||
| context = this, | ||
| clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass over your Web3Auth Client ID from Developer Dashboard | ||
| network = Network.MAINNET, | ||
| redirectUrl = Uri.parse("{YOUR_APP_PACKAGE_NAME}://auth"), | ||
| web3AuthNetwork = Web3AuthNetwork.SAPPHIRE_MAINNET, | ||
| redirectUrl = "{YOUR_APP_PACKAGE_NAME}://auth", | ||
| ) | ||
| ) | ||
| // focus-end | ||
|
|
@@ -50,21 +51,24 @@ The Web3Auth Constructor takes an object with `Web3AuthOptions` as input. | |
| | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | `context` | Android context to launch Web-based authentication, usually is the current activity. It's a mandatory field, and accepts `android.content.Context` as a value. | | ||
| | `clientId` | Your Web3Auth Client ID. You can get it from Web3Auth [Dashboard](https://dashboard.web3auth.io/) under project details. It's a mandatory field of type `String` | | ||
| | `network` | Defines the Web3Auth Network. It's a mandatory field of type Network. | | ||
| | `redirectUrl` | URL that Web3Auth will redirect API responses upon successful authentication from browser. It's a mandatory field of type `Uri`. | | ||
| | `web3AuthNetwork` | Defines the Web3Auth Network. It's a mandatory field of type `Web3AuthNetwork`. | | ||
| | `redirectUrl` | URL that Web3Auth will redirect API responses upon successful authentication from browser. It's a mandatory field of type `String`. | | ||
|
Comment on lines
+54
to
+55
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are lot of new parameters added. Top of my head, missing default chain id, account abstraction config.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added |
||
| | `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, default is 86400 seconds which is 1 day. `sessionTime` can be max 30 days | | ||
| | `useCoreKitKey?` | Use CoreKit (or SFA) Key to get core kit key given by SFA SDKs. It's an optional field with default value as `false`. Useful for Wallet Pregeneration. | | ||
| | `chainNamespace?` | Chain Namespace [`EIP155` and `SOLANA`]. It takes `ChainNamespace` as a value. | | ||
| | `useSFAKey?` | Use SFA Key to get single factor auth key. It's an optional field with default value as `false`. Useful for Wallet Pregeneration and SFA mode. | | ||
| | `chains?` | Custom chain configuration for blockchain networks. It takes `Chains` as a value. | | ||
| | `defaultChainId?` | Default chain ID to use. It's an optional field with default value as `null`. The first chain in the list will be used if not provided. | | ||
| | `enableLogging?` | Setting to true will enable logs. It's an optional field with default value as `false`. | | ||
|
|
||
| </TabItem> | ||
|
|
||
| <TabItem value="advanced"> | ||
|
|
||
| | Parameter | Description | | ||
| | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | `whiteLabel?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `WhiteLabelData` as a value. | | ||
| | `loginConfig?` | Login config for the custom verifiers. It takes `HashMap<String, LoginConfigItem>` as a value. | | ||
| | `mfaSettings?` | Allows developers to configure the Mfa settings for authentication. It takes `MfaSettings` as a value. | | ||
| | Parameter | Description | | ||
| | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | `whiteLabel?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `WhiteLabelData` as a value. | | ||
| | `authConnectionConfig?` | Auth connection config for the custom auth connections. It takes `List<AuthConnectionConfig>` as a value. | | ||
| | `mfaSettings?` | Allows developers to configure the MFA settings for authentication. It takes `MfaSettings` as a value. | | ||
| | `walletServicesConfig?` | Configuration for wallet services including whitelabel options. It takes `WalletServicesConfig` as a value. | | ||
|
|
||
| </TabItem> | ||
|
|
||
|
|
@@ -74,16 +78,19 @@ The Web3Auth Constructor takes an object with `Web3AuthOptions` as input. | |
| data class Web3AuthOptions( | ||
| var context: Context, | ||
| val clientId: String, | ||
| val network: Network, | ||
| var buildEnv: BuildEnv? = BuildEnv.PRODUCTION, | ||
| @Transient var redirectUrl: Uri, | ||
| var sdkUrl: String = getSdkUrl(buildEnv), | ||
| val web3AuthNetwork: Web3AuthNetwork, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing few, can't see account abstraction config.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added |
||
| var authBuildEnv: BuildEnv? = BuildEnv.PRODUCTION, | ||
| var redirectUrl: String, | ||
| var sdkUrl: String = getSdkUrl(authBuildEnv), | ||
| val whiteLabel: WhiteLabelData? = null, | ||
| val loginConfig: HashMap<String, LoginConfigItem>? = null, | ||
| val useCoreKitKey: Boolean? = false, | ||
| val chainNamespace: ChainNamespace? = ChainNamespace.EIP155, | ||
| val authConnectionConfig: List<AuthConnectionConfig>? = null, | ||
| val useSFAKey: Boolean? = false, | ||
| val chains: Chains? = null, | ||
| val mfaSettings: MfaSettings? = null, | ||
| val sessionTime: Int? = 86400 | ||
| val sessionTime: Int = 86400, | ||
| val walletServicesConfig: WalletServicesConfig? = null, | ||
| val defaultChainId: String? = null, | ||
| val enableLogging: Boolean? = false | ||
| ) | ||
| ``` | ||
|
|
||
|
|
@@ -106,9 +113,9 @@ var web3Auth = Web3Auth( | |
| Web3AuthOptions( | ||
| context = this, | ||
| clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass over your Web3Auth Client ID from Developer Dashboard | ||
| network = Network.MAINNET, | ||
| web3AuthNetwork = Web3AuthNetwork.SAPPHIRE_MAINNET, | ||
| sessionTime = 86400 * 7, // 7 days (in seconds) | ||
| redirectUrl = Uri.parse("{YOUR_APP_PACKAGE_NAME}://auth"), | ||
| redirectUrl = "{YOUR_APP_PACKAGE_NAME}://auth", | ||
| ) | ||
| ) | ||
| ``` | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is changed, the
initializemethod will throw an error that needs to be swallowed if the session is not present.initializemethod can fail if the session is not present, or if there is an network issue to get the dashboard configuration, or session validation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added extra context