iOS
Portal provides MPC wallets and dApp connections for organizations and their users. To integrate Portal, an organization adds a client library to their mobile app and a few server API endpoints.
![](https://docs.portalhq.io/~gitbook/image?url=https%3A%2F%2F1744168258-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F8fkrdVt5Nxou2X995uAB%252Fuploads%252FxUfW1Q7zIZ59oPJ8KlFx%252Fimage.png%3Falt%3Dmedia%26token%3Db7c1f34c-f258-4eca-82eb-84601e910bfe&width=768&dpr=4&quality=100&sign=74c4b9cc&sv=1)
Installation
We support Cocoa Pods and Swift Package Manager as distribution methods for our swift package.
Setup
Add this to your pod file:
Run pod install
.
If you are running an xcode project and need to run pod init
and run into ruby or xcode errors, ensure your xcode project is compatible with an xcode version lower than 14.
After you run pod install
you should see a PROJECT_NAME.xcworkspace
file. Open that file with xcode. You will need to work within that file to properly have the pod linked.
Initializing Portal
We can now create an instance of the Portal
class. Below is an example of how you can do this:
Now that we have our Portal instance, the next step is to generate wallets for your user. Let's create them!
If you are using Client Session Tokens (CSTs), this hint is for you.
When your user's CST expires, all Portal SDKs will throw an error on the next MPC Operation the user makes (e.g. creating a wallet, backing up a wallet, recovering a wallet, or signing). That error will include a code SESSION_EXPIRED
in the SDK methods, which you can use as an indicator to refresh your CST.
Last updated