Getting started
In this guide we show how to use it.
A sample application is available at: https://github.com/portto/blocto-ios-sdk/tree/main/Example

Installation

An easy way to add Blocto iOS SDK dependency to an iOS project is through CocoaPods, like this:
1
pod 'BloctoSDK/Solana'
Copied!
The dependency can be installed simply by pod install:
1
pod install
Copied!
BloctoSDK start support Solana from version 0.1.0 with Blocto Wallet app from 3.7.0.

Usage

Initialize Blocto SDK

1
if #available(iOS 13.0, *) {
2
BloctoSDK.shared.initialize(
3
with: "YOUR_APP_ID", // required
4
window: yourWindow, // required PresentationContextProvider of web SDK authentication.
5
logging: true, // optional (default is true)
6
testnet: true // optional (default is false)
7
)
8
} else {
9
BloctoSDK.shared.initialize(
10
with: "YOUR_APP_ID", // required
11
logging: true, // optional (default is true)
12
testnet: true // optional (default is false)
13
)
14
}
Copied!
parameter testnet: specify the cluster.true for devnet andfalse for mainnet-beta. Default is false.

UIApplicationDelegate delegate method implementation

1
func application(
2
_ app: UIApplication,
3
open url: URL,
4
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
5
) -> Bool {
6
BloctoSDK.shared.application(
7
app,
8
open: url,
9
options: options)
10
return true
11
}
Copied!
1
func application(
2
_ application: UIApplication,
3
continue userActivity: NSUserActivity,
4
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
5
) -> Bool {
6
BloctoSDK.shared.continue(userActivity)
7
return true
8
}
Copied!
Copy link