Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

:::
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.

:::tip building locally
If you need help, visit the [Web3Auth Community](https://web3auth.io/community/).

- 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).
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as initialization from './initialize.mdx'
import * as installation from './installation.mdx'
import * as login from './login.mdx'
import * as logout from './logout.mdx'

import * as iOSQuickStart from './iOSQuickStart.mdx'

const STEPS = toSteps({
Expand Down
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).

:::
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

Add the MetaMask Web3Auth iOS SDK to your project

1. In Xcode, with your app project open, navigate to **File > Add Packages**.
1. In Xcode, open your project and select **File > Add Packages**.

1. When prompted, add the Web3Auth iOS SDK repository:

```bash
https://github.com/Web3Auth/web3auth-swift-sdk
```

From the `Dependency Rule` dropdown, select `Exact Version` and enter the [latest version](https://github.com/Web3Auth/web3auth-swift-sdk/releases).
1. For **Dependency Rule**, select **Exact Version**, then enter the [latest version](https://github.com/Web3Auth/web3auth-swift-sdk/releases).

1. When finished, Xcode will automatically begin resolving and downloading your dependencies in the background.
Xcode automatically resolves and downloads the dependencies in the background.

:::tip SDK Reference

- [Installing Web3Auth](/embedded-wallets/sdk/ios/install).
See [installing Web3Auth](/embedded-wallets/sdk/ios#installation).

:::
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.
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.
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:

- 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`.
Loading