Initialize

This document describes the initialization steps for using the iOS SDK in your project.

Obtaining Fncy AuthToken

  • Link for instructions on how to get your AuthToken.

Declaring Initialization in the AppDelegate

To use the FncyWalletSDK in your project, select your development environment and call initSDK.

The environment can be either testnet or mainnet.

  • Testnet : .testnet

  • Mainnet : .mainnet

import FncyWallet

class AppDelegate: UIResponder, UIApplicationDelegate {
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    
        ...
        // FncyWalletSDK initialize
        FncyWalletSDK.initSDK(environment: .testnet) // .testnet or .mainnet
        
        return true
    }
    ...
}

Create FncyWalletCore Object

After iOS SDK initialization, an instance of FncyWalletCore object with the authentication token as a parameter is required to communicate with the wallet server.

import UIKit
import FncyWallet

class ViewController : UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        //Creates an FncyWalletCore object to communicate with the wallet server with the authentication token as a parameter.
        let fncyWallet = FncyWalletCore(authToken: authToken)
        
        
    }
}

Last updated