mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Add crashlytics (WIP)
This commit is contained in:
parent
4efc28da9e
commit
3f4e8d79cf
3 changed files with 23 additions and 2 deletions
|
|
@ -18,6 +18,9 @@
|
|||
*/
|
||||
|
||||
import SwiftUI
|
||||
#if USE_CRASHLYTICS
|
||||
import Firebase
|
||||
#endif
|
||||
|
||||
@main
|
||||
struct LinphoneApp: App {
|
||||
|
|
@ -32,6 +35,12 @@ struct LinphoneApp: App {
|
|||
@State private var startCallViewModel: StartCallViewModel?
|
||||
@State private var callViewModel: CallViewModel?
|
||||
|
||||
init() {
|
||||
#if USE_CRASHLYTICS
|
||||
FirebaseApp.configure()
|
||||
#endif
|
||||
}
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
if coreContext.coreIsStarted {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ import UIKit
|
|||
import os
|
||||
import linphonesw
|
||||
import linphone
|
||||
#if USE_CRASHLYTICS
|
||||
import Firebase
|
||||
#endif
|
||||
|
||||
class Log: LoggingServiceDelegate {
|
||||
|
||||
|
|
@ -88,6 +91,9 @@ class Log: LoggingServiceDelegate {
|
|||
} else {
|
||||
NSLog(log)
|
||||
}
|
||||
#if USE_CRASHLYTICS
|
||||
Crashlytics.crashlytics().log("\(levelStr) [\(domain)] \(message)\n")
|
||||
#endif
|
||||
}
|
||||
|
||||
func onLogMessageWritten(logService: linphonesw.LoggingService, domain: String, level: linphonesw.LogLevel, message: String) {
|
||||
|
|
|
|||
10
Podfile
10
Podfile
|
|
@ -9,10 +9,16 @@ def basic_pods
|
|||
else
|
||||
pod 'linphone-sdk', :path => ENV['PODFILE_PATH'] # local sdk
|
||||
end
|
||||
|
||||
|
||||
crashlytics
|
||||
end
|
||||
|
||||
|
||||
def crashlytics
|
||||
if not ENV['USE_CRASHLYTICS'].nil?
|
||||
pod 'Firebase/Analytics'
|
||||
pod 'Firebase/Crashlytics'
|
||||
end
|
||||
end
|
||||
|
||||
target 'Linphone' do
|
||||
# Comment the next line if you don't want to use dynamic frameworks
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue