Skip to content

Commit 7b80171

Browse files
update swift pnp to v11.1.0
1 parent a7a2d4e commit 7b80171

File tree

5 files changed

+64
-6
lines changed

5 files changed

+64
-6
lines changed

docs/sdk/pnp/ios/usage.mdx

Lines changed: 59 additions & 1 deletion
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,63 @@ try await web3auth.logout()
352353

353354
<EnableMFAMethod />
354355

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

357415
The `launchWalletServices` method launches a WebView which allows you to use the templated wallet UI
@@ -465,7 +523,7 @@ do {
465523
params.append(address)
466524

467525
// focus-start
468-
let response = try await self.web3Auth?.request(
526+
let response = try await web3Auth?.request(
469527
chainConfig: ChainConfig(
470528
chainId: "11155111",
471529
rpcTarget: "https://eth-sepolia.public.blastapi.io"

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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)