Skip to content

Commit f3444cf

Browse files
authored
Merge pull request #1078 from Web3Auth/swift-pnp/11.1.0
[Swift PnP] Update docs to v11.1.0
2 parents ed18025 + 5702f18 commit f3444cf

File tree

5 files changed

+62
-6
lines changed

5 files changed

+62
-6
lines changed

docs/sdk/pnp/ios/usage.mdx

+57-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import EnableMFAMethod from "@site/src/common/sdk/pnp/ios/_enable-mfa.mdx";
2121
| [getEd25519PrivKey](#ed25519-private-key) | Retrieve the user's ed25519 key. The key can be used to sign transactions for chains using the ed25519 curve like Solana, Near, Algorand, and others. |
2222
| [getUserInfo](#retrieve-user-information) | Retrieve the user information, such as login provider, name, email, oAuth token, etc. |
2323
| [enableMFA](#enable-mfa-for-a-user) | Use to trigger the setup MFA flow for the users. |
24+
| [manageMFA](#manage-mfa-for-a-user) | Use to trigger the manage MFA flow for the users. |
2425
| [launchWalletServices](#launch-wallet-services) | Use to open the templated wallet UI in WebView. |
2526
| [request](#request-signature) | Use to open templated transaction screens for signing EVM transactions. |
2627

@@ -352,6 +353,61 @@ try await web3auth.logout()
352353

353354
<EnableMFAMethod />
354355

356+
## Manage MFA for a user
357+
358+
The `manageMFA` method is used to trigger manage MFA flow for users, allowing users to update their
359+
MFA settings. The method takes `W3ALoginParams` which will used during custom verifiers. If you are
360+
using default login providers, you don't need to pass `W3ALoginParams`. If you are using custom jwt
361+
verifiers, you need to pass the JWT token in `loginParams` as well.
362+
363+
<Tabs
364+
defaultValue="default-verifier"
365+
values={[
366+
{ label: "Default Verifier", value: "default-verifier" },
367+
{ label: "Custom JWT Verifier", value: "custom-jwt-verifier" },
368+
]}
369+
>
370+
371+
<TabItem value = "default-verifier">
372+
373+
```swift
374+
do {
375+
let response = try await web3Auth.manageMFA()
376+
if response {
377+
// Handle success
378+
} else {
379+
// Something went wrong
380+
}
381+
} catch {
382+
// Handle error
383+
}
384+
```
385+
386+
</TabItem>
387+
388+
<TabItem value="custom-jwt-verifier">
389+
390+
```swift
391+
let loginParams = W3ALoginParams(
392+
loginProvider: .JWT,
393+
extraLoginOptions: .init(id_token: "your_jwt_token")
394+
)
395+
396+
do {
397+
let response = try await web3Auth.manageMFA(loginParams)
398+
if response {
399+
// Handle success
400+
} else {
401+
// Something went wrong
402+
}
403+
} catch {
404+
// Handle error
405+
}
406+
```
407+
408+
</TabItem>
409+
</Tabs>
410+
355411
## Launch Wallet Services
356412

357413
The `launchWalletServices` method launches a WebView which allows you to use the templated wallet UI
@@ -465,7 +521,7 @@ do {
465521
params.append(address)
466522

467523
// focus-start
468-
let response = try await self.web3Auth?.request(
524+
let response = try await web3Auth?.request(
469525
chainConfig: ChainConfig(
470526
chainId: "11155111",
471527
rpcTarget: "https://eth-sepolia.public.blastapi.io"

src/common/sdk/pnp/ios/_cocoapods.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ To install the Web3Auth SDK using Cocoapods, follow the below steps:
33
1. Open the Podfile, and add the Web3Auth pod:
44

55
```sh
6-
pod 'Web3Auth', '~> 11.0.5'
6+
pod 'Web3Auth', '~> 11.1.0'
77
```
88

99
2. Once added, use `pod install` command to download the Web3Auth dependency.

src/common/sdk/pnp/ios/_enable-mfa.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ do {
3333
```swift
3434
do {
3535
let loginParams = W3ALoginParams(
36-
.JWT,
36+
loginProvider: .JWT,
3737
extraLoginOptions: .init(id_token: "your_jwt_token")
3838
)
3939

40-
let isMFAEnabled = try await web3Auth.enableMFA(loginParams)
40+
let isMFAEnabled = try await web3Auth.enableMFA(loginParams)
4141

4242
} catch {
4343
print(error.localizedDescription)

src/common/sdk/pnp/ios/_spm.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
https://github.com/Web3Auth/web3auth-swift-sdk
77
```
88

9-
From the `Dependency Rule` dropdown, select `Exact Version` and enter `11.0.5` as the version.
9+
From the `Dependency Rule` dropdown, select `Exact Version` and enter `11.1.0` as the version.
1010

1111
3. When finished, Xcode will automatically begin resolving and downloading your dependencies in the
1212
background.

src/common/versions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const pnpWebVersion = `9.3.x`;
22
export const pnpAndroidVersion = `9.1.2`;
3-
export const pnpIOSVersion = `11.0.5`;
3+
export const pnpIOSVersion = `11.1.0`;
44
export const pnpRNVersion = `8.1.x`;
55
export const pnpFlutterVersion = `6.1.2`;
66
export const pnpUnityVersion = `5.x.x`;

0 commit comments

Comments
 (0)