相关引用
导入过程
1. 使用pod导入
pod 'Bugly'
2. 手动接入
- 下载Bugly iOS SDK
- 拖拽
Bugly.framework
文件到Xcode工程内(请勾选Copy items if needed
选项) - 添加依赖库
SystemConfiguration.framework
Security.framework
libz.dylib
或libz.tbd
libc++.dylib
或libc++.tbd
3. 初始化SDK
在工程的 AppDelegate.m
文件导入头文件
#import <Bugly/Bugly.h>
如果是Swift工程,请在对应bridging-header.h
中导入
初始化Bugly
- Object-C
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[Bugly startWithAppId:@"此处替换为你的AppId"];
return YES;
}
- Swift
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
Bugly.startWithAppId("此处替换为你的AppId")
return true
}
- 正常的使用
let TENCENT_BUGLY_APPID = "900001055"
let CHANNEL_CODE = "iOS"
public func setupBugly() {
let bugConfig = BuglyConfig()
bugConfig.channel = CHANNEL_CODE
bugConfig.version = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String
Bugly.start(withAppId: TENCENT_BUGLY_APPID, config: bugConfig)
}