Skip to main content

Collect Application Launch Parameters

1、Open Xcode, then select File -> New -> File (or ⌘N).

swift1

2、In the dialog box that appears, select Swift File and click Next.

swift2

3、Name the Swift file "main".

swift3

4、In the AppDelegate.swift file, comment out @UIApplicationMain as shown in the following image.

swift4

5、Add the following code to the "main.swift" file.

import Foundation
import UIKit
NBSAppAgent.start(withAppID: "your_appKey") // The Basis TingYun SDK startup function.
UIApplicationMain(
CommandLine.argc,
UnsafeMutableRawPointer(CommandLine.unsafeArgv)
.bindMemory(
to: UnsafeMutablePointer<Int8>.self,
capacity: Int(CommandLine.argc)),
nil,
NSStringFromClass(AppDelegate.self)
)