# Initialize

### Obtaining Fncy AuthToken

* Link for instructions on how to get your [AuthToken](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/with-fncy/fncy-login).

### 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

```swift
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&#x20;

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

```swift
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)
        
        
    }
}
```
