我試圖在Google Analytics中爲我的應用使用例外跟蹤功能。 https://developers.google.com/analytics/devguides/collection/ios/v3/exceptionsSwift中Google Analytics(分析)異常跟蹤的正確語法是什麼?
我只是想弄清楚在斯威夫特這句法(不是超級熟悉的OBJ-C):
@try {
// Request some scores from the network.
NSArray *highScores = [self getHighScoresFromCloud];
}
@catch (NSException *exception) {
// May return nil if a tracker has not already been initialized with a
// property ID.
id tracker = [[GAI sharedInstance] defaultTracker];
[tracker send:[[GAIDictionaryBuilder
createExceptionWithDescription:@"Connection timout %d: %@", connectionError, errorDescription // Exception description. May be truncated to 100 chars.
withFatal:@NO] build]]; // isFatal (required). NO indicates non-fatal exception.
}
我已經建立了我的跟蹤好,這是工作的罰款節能其他數據給GA,這只是在Swift中調用createExceptionWithDescription()
的語法,我不確定。
有肯定不會出現在示例/文檔的方式多使用斯威夫特谷歌Analytics(分析)... = /如果你知道的任何,請讓我知道!
謝謝。