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:
pod 'BloctoSDK/EVMBase'
The dependency can be installed simply by pod install:
pod install
BloctoSDK start support EVMBase from version 0.2.1 with Blocto Wallet app from 3.8.0.

Usage

Initialize Blocto SDK

if #available(iOS 13.0, *) {
BloctoSDK.shared.initialize(
with: "YOUR_APP_ID", // required
window: yourWindow, // required PresentationContextProvider of web SDK authentication.
logging: true, // optional (default is true)
testnet: true // optional (default is false)
)
} else {
BloctoSDK.shared.initialize(
with: "YOUR_APP_ID", // required
logging: true, // optional (default is true)
testnet: true // optional (default is false)
)
}
parameter testnet: specify the network. Default is false. in Ethereumtrue for Rinkeby and false for mainnet. in BSCtrue for testnet and false for mainnet. in Polygontrue for Mumbai and false for mainnet. in Avalanchetrue for FUJI Testnet and false for mainnet.

UIApplicationDelegate delegate method implementation

func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
BloctoSDK.shared.application(
app,
open: url,
options: options)
return true
}
func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
BloctoSDK.shared.continue(userActivity)
return true
}
Copy link