-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72492ba
commit 900b851
Showing
2 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
--- | ||
title: PnP Android SDK - v4 to v5 | ||
displayed_sidebar: docs | ||
description: "PnP Android SDK - v4 to v5 | Documentation - Web3Auth" | ||
sidebar_label: v4 to v5 | ||
--- | ||
|
||
## General | ||
|
||
### openlogin v5 is supported | ||
|
||
With V5, Users can now log in from sapphire mainnet and sapphire testnet. | ||
|
||
```tsx | ||
// With V5 | ||
// highlight-start | ||
web3Auth = Web3Auth( | ||
Web3AuthOptions( | ||
... | ||
// highlight-start | ||
network = Network.SAPPHIRE_MAINNET, // pass over the network you want to use (MAINNET or TESTNET or CYAN, AQUA, SAPPHIRE_MAINNET or SAPPHIRE_TESTNET) // highlight-end | ||
... | ||
) | ||
) | ||
``` | ||
|
||
### Android Compile and Target SDK: `34`. | ||
|
||
In V5, android compile target sdk is changed from 33 to 34. If you previously used the target SDK with 33, update your build.gradle file. | ||
|
||
```tsx | ||
// With V5 | ||
android { | ||
compileSdk 34 | ||
|
||
defaultConfig { | ||
applicationId "com.sbz.web3authdemoapp" | ||
minSdk 24 | ||
targetSdk 34 | ||
versionCode 1 | ||
versionName "1.0" | ||
... | ||
|
||
} | ||
} | ||
``` | ||
|
||
### Web3AuthOptions param configuration changed | ||
|
||
In v5, the way parameters are configured has changed. The buildEnv parameter must be included. The whiteLabel parameter type and configuration has | ||
changed. And, as mentioned earlier, the network type has been added. | ||
|
||
#### change of WhiteLabel parameter configuration | ||
|
||
##### v4 | ||
|
||
<TabItem value="table"> | ||
|
||
| Parameter | Type | Mandatory | Description | | ||
| ----------------- | ------------------ | --------- | ------------------------------------------------- | | ||
| `name` | `String` | No | Name of your application | | ||
| `logoLight` | `String` | No | Light logo for dark background | | ||
| `logoDark` | `String` | No | Dark logo for light background | | ||
| `defaultLanguage` | `String` | No | Default translation language to be used | | ||
| `dark` | `Boolean` | No | If true, enables dark mode. Default is light mode | | ||
| `theme` | `Map<String, Any>` | No | Whitelabel theme | | ||
|
||
</TabItem> | ||
|
||
##### v5 | ||
|
||
<TabItem value="table"> | ||
|
||
| Parameter | Type | Mandatory | Description | | ||
| ----------------- | ------------------ | --------- | --------------------------------------- | | ||
| `appName` | `String` | No | Name of your application | | ||
| `appUrl` | `String` | No | Url of your application | | ||
| `logoLight` | `String` | No | Light logo for dark background | | ||
| `logoDark` | `String` | No | Dark logo for light background | | ||
| `defaultLanguage` | `String` | No | Default translation language to be used | | ||
| `mode` | `Boolean` | No | 3 Theme modes of the application | | ||
| `theme` | `Map<String, Any>` | No | Whitelabel theme | | ||
| `useLogoLoader` | `Boolean` | No | Loads the logo when loading | | ||
|
||
</TabItem> | ||
|
||
Here's the example configuration of Web3AuthOptions. | ||
|
||
```tsx | ||
web3Auth = Web3Auth( | ||
Web3AuthOptions( | ||
context = this, | ||
clientId = getString(R.string.web3auth_project_id), // pass over your Web3Auth Client ID from Developer Dashboard | ||
network = Network.CYAN, // pass over the network you want to use (MAINNET or TESTNET or CYAN or AQUA or SAPPHIRE_MAINNET or SAPPHIRE_TESTNET) | ||
// highlight-start | ||
buildEnv = BuildEnv.TESTING, // 3 options available: PRODUCTION, STAGING, TESTING | ||
// highlight-end | ||
redirectUrl = Uri.parse("com.sbz.web3authdemoapp://auth"), // your app's redirect URL | ||
// Optional parameters | ||
// highlight-start | ||
whiteLabel = WhiteLabelData( | ||
"Web3Auth Android Auth0 Example", null, null, null, Language.EN, ThemeModes.LIGHT, true, | ||
hashMapOf( | ||
"primary" to "#eb5424" | ||
) | ||
), | ||
// highlight-end | ||
loginConfig = hashMapOf("jwt" to LoginConfigItem( | ||
verifier = "web3auth-auth0-demo", | ||
typeOfLogin = TypeOfLogin.JWT, | ||
name = "Auth0 Login", | ||
clientId = getString(R.string.web3auth_auth0_client_id) | ||
)) | ||
) | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters