采集应用启动参数

1、打开Xcode,依次选择File→New→File(或者⌘N)。swift1

2、在弹出的对话框中选择Swift File,单击Next。swift2

3、将Swift文件命名为main。swift3

4、在AppDelegate.swift文件中注释 @UIApplicationMain ,如下图所示。swift4

5、在main.swift文件中添加如下代码。

import Foundation
import UIKit
NBSAppAgent.start(withAppID: "your_appKey") // 基调听云sdk启动函数
UIApplicationMain(
    CommandLine.argc,
    UnsafeMutableRawPointer(CommandLine.unsafeArgv)
        .bindMemory(
            to: UnsafeMutablePointer<Int8>.self,
            capacity: Int(CommandLine.argc)),
    nil,
    NSStringFromClass(AppDelegate.self)
)
© 2007-2024 北京基调网络股份有限公司 all right reserved,powered by Gitbook本文档更新于: 2023-11-07 10:58

results matching ""

    No results matching ""