-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Edit the Embedded Wallet builder (iOS) #2281
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
Open
bgravenorst
wants to merge
15
commits into
main
Choose a base branch
from
ew-builder-ios
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+46
−61
Open
Changes from 7 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
47a35ed
Added prerequisites.
bgravenorst b68c6d2
Merge remote-tracking branch 'origin/main' into ew-builder-ios
bgravenorst db55e17
Fixed broken links.
bgravenorst 0137bc9
Fix link.
bgravenorst c325daa
Address reviewer feedback.
bgravenorst 6d9496b
Improve step description.
bgravenorst 7abee07
Minor language edit.
bgravenorst 8f723cb
Update src/pages/quickstart/builder/embedded-wallets/ios/stepContent/…
yashovardhan fb2212b
Merge branch 'main' into ew-builder-ios
yashovardhan 33cce72
Fix deeplink urls (#2293)
alexandratran ec5afe6
Edit the embedded wallets React builder component. (#2292)
bgravenorst 7f50a90
Address reviewer feedback.
bgravenorst 96e2153
Remove text.
bgravenorst ba9cbe9
Merge branch 'main' into ew-builder-ios
bgravenorst dd39db4
Merge branch 'main' into ew-builder-ios
yashovardhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
8 changes: 5 additions & 3 deletions
8
src/pages/quickstart/builder/embedded-wallets/ios/stepContent/blockchainCalls.mdx
This file contains hidden or 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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
### Making Blockchain Calls | ||
### Make blockchain calls | ||
|
||
While using the Web3Auth Swift/iOS SDK, you get the private key within the user scope. This means that you can use it with any blockchain with their corresponding library within the Swift/iOS environment. | ||
With the Web3Auth iOS/Swift SDK, you can derive the user's private key in memory for the current session. | ||
Use that key for any blockchain using their corresponding library in the Swift/iOS environment. | ||
|
||
:::info Connect any Blockchain | ||
|
||
Refer to the [Blockchain Documentation](/connect-blockchain/) to know more about how to make calls on any blockchain. | ||
Refer to the [blockchain documentation](/embedded-wallets/connect-blockchain/) to learn more about making calls on | ||
any supported blockchain. | ||
|
||
::: |
36 changes: 17 additions & 19 deletions
36
src/pages/quickstart/builder/embedded-wallets/ios/stepContent/iOSQuickStart.mdx
This file contains hidden or 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 |
---|---|---|
@@ -1,28 +1,26 @@ | ||
### MetaMask Embedded Wallets Swift/iOS Quick Start | ||
### MetaMask Embedded Wallets iOS/Swift quickstart | ||
|
||
This guide is designed to help you quickly integrate a basic instance of MetaMask Embedded Wallet SDKs in your Swift/iOS app. | ||
This quickstart is designed to help you quickly integrate MetaMask Embedded Wallet SDKs in your | ||
iOS or Swift app. | ||
|
||
If you face any problem anytime, you can always find help in the [Web3Auth Community](https://web3auth.io/community/c/help-pnp/pnp-ios/17). | ||
To view the quickstart for a different platform, select the dropdown in the menu bar and choose your target | ||
platform. For example, Android, React, Flutter, Angular, and others. | ||
bgravenorst marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
:::tip building locally | ||
If you need help, visit the [Web3Auth Community](https://web3auth.io/community/). | ||
|
||
bgravenorst marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Clone the MetaMask Embedded Wallets Swift/iOS Quick Start Application | ||
#### Prerequisites | ||
|
||
```shell npm2yarn | ||
npx degit Web3Auth/web3auth-ios-examples/ios-quick-start w3a-ios-quick-start | ||
``` | ||
- iOS 14+ | ||
- Xcode 12+ | ||
- Swift 5.x | ||
|
||
- Install & Run | ||
Build the project locally: | ||
|
||
```shell npm2yarn | ||
cd w3a-ios-quick-start | ||
### run project in Xcode | ||
``` | ||
1. Clone the MetaMask Embedded Wallets Swift/iOS quickstart application: | ||
|
||
::: | ||
```shell npm2yarn | ||
npx degit Web3Auth/web3auth-ios-examples/ios-quick-start w3a-ios-quick-start | ||
``` | ||
|
||
:::note Requirements | ||
|
||
- iOS 14+, Xcode 11.4+ / 12.x & Swift 4.x / 5.x | ||
|
||
::: | ||
1. Open the project in Xcode from the `w3a-ios-quick-start` directory and | ||
[build the app](https://developer.apple.com/documentation/xcode/building-and-running-an-app). |
This file contains hidden or 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
15 changes: 9 additions & 6 deletions
15
src/pages/quickstart/builder/embedded-wallets/ios/stepContent/initialize.mdx
This file contains hidden or 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 |
---|---|---|
@@ -1,13 +1,16 @@ | ||
### Create and initialize the Web3Auth instance | ||
### Create and initialize Web3Auth | ||
|
||
Let's now create an instance of the `Web3Auth`. | ||
Create an instance of `web3Auth` for your app. | ||
|
||
We need `clientId` and `network` to initialize the web3auth class. You can get your `clientId` from registering (above), whereas `network` signifies the type of network(`SAPPHIRE_MAINNET` or `SAPPHIRE_DEVNET` ) you want to initialize web3auth with. | ||
You'll need two values: | ||
|
||
Now, let's create an instance of the `Web3Auth` class. It can be initialized on-demand when the user interactions are input (like button click) or when the screen is initialized. | ||
- `clientId` - from the Web3Auth dashboard after registration. | ||
- `network` - choose `SAPPHIRE_MAINNET`or `SAPPHIRE_DEVNET` to initialize Web3Auth with. | ||
|
||
:::info sdk reference | ||
Initialize `web3Auth` on-demand (for example, on a button tap) or when the screen loads. | ||
|
||
Read more about [iOS SDK](/embedded-wallets/sdk/ios). | ||
:::info SDK reference | ||
|
||
Read more about the [iOS SDK](/embedded-wallets/sdk/ios). | ||
|
||
::: |
This file contains hidden or 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
14 changes: 5 additions & 9 deletions
14
src/pages/quickstart/builder/embedded-wallets/ios/stepContent/login.mdx
This file contains hidden or 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 |
---|---|---|
@@ -1,11 +1,7 @@ | ||
### Logging in your User | ||
### Sign in the user | ||
|
||
Use the `login` function in the Web3Auth Instance to log in the user. Just create a button that triggers the `login` for the user of the login method of their choice. | ||
Use the [`login`](/embedded-wallets/sdk/ios/usage/login) function of the | ||
`web3Auth` instance to sign in the user. You can trigger it from a button or other user action. | ||
|
||
After a successful user login, Web3Auth will redirect back to your app, with a payload stored in the state of the Web3Auth Instance. | ||
|
||
:::info SDK Reference | ||
|
||
- [`login()` function](/embedded-wallets/sdk/react-native/usage#logging-in-a-user). | ||
|
||
::: | ||
After a successful user sign-in, Web3Auth returns the user to your app, with a payload stored in the | ||
state of the `web3Auth` instance. |
10 changes: 2 additions & 8 deletions
10
src/pages/quickstart/builder/embedded-wallets/ios/stepContent/logout.mdx
This file contains hidden or 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 |
---|---|---|
@@ -1,9 +1,3 @@ | ||
### Log the user out | ||
### Sign out the user | ||
|
||
Use the `logout` function of the Web3Auth Instance to log the user out. | ||
|
||
:::info SDK Reference | ||
|
||
- [`logout()` function](/embedded-wallets/sdk/react-native/usage#logging-out-a-user). | ||
|
||
::: | ||
Use the [`logout`](/embedded-wallets/sdk/ios/usage/logout) function to sign the user out. |
8 changes: 4 additions & 4 deletions
8
src/pages/quickstart/builder/embedded-wallets/ios/stepContent/whitelist.mdx
This file contains hidden or 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
### Whitelist Bundle ID | ||
### Whitelist your bundle ID | ||
|
||
To whitelist, you'll need to | ||
To whitelist, your app: | ||
|
||
yashovardhan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Select your Web3Auth project in the [Developer Dashboard](https://dashboard.web3auth.io). | ||
1. In the [Web3Auth dashboard](https://dashboard.web3auth.io), select your project. | ||
|
||
- Add `(bundleId)://auth` to **Whitelist URLs** section. | ||
1. Select the **Domains** tab. In **Whitelist URLs**, add `<bundleId>://auth`. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.