Flurry setCrashReportingEnabled(true)在Swift中折旧
问题描述:
在iOS/xCode/Swift中,自升级到Flurry iOS SDK的最新版本后,我得到“Flurry.setCrashReportingEnabled is depreciated
”。Flurry setCrashReportingEnabled(true)在Swift中折旧
这是我的代码:
...
//start flurry
Flurry.setCrashReportingEnabled(true)
Flurry.startSession(environment.flurryAPIKey)
...
看Flurry iOS SDK GitHub project我找到了“因为7.7.0过时,请在地方调用这个API的使用FlurrySessionBuilder。”
但是我无法在Swift中找到关于此FlurrySessionBuilder用法的任何信息。 如何将上面的代码转换为使用此FlurrySessionBuilder摆脱此折旧的警告?
答
后接触的支持乱舞支持我终于在这里找到了答案:
https://developer.yahoo.com/flurry/docs/integrateflurry/ios/#initialize-flurry
let builder = FlurrySessionBuilder.init()
.withAppVersion("1.0")
.withLogLevel(FlurryLogLevelAll)
.withCrashReporting(true)
.withSessionContinueSeconds(10)
// Replace YOUR_API_KEY with the api key in the downloaded package
Flurry.startSession("YOUR_API_KEY", with: builder)