forked from mirrors/linphone-iphone
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
|
import SwiftUI
|
||||||
|
#if USE_CRASHLYTICS
|
||||||
|
import Firebase
|
||||||
|
#endif
|
||||||
|
|
||||||
@main
|
@main
|
||||||
struct LinphoneApp: App {
|
struct LinphoneApp: App {
|
||||||
|
|
@ -32,6 +35,12 @@ struct LinphoneApp: App {
|
||||||
@State private var startCallViewModel: StartCallViewModel?
|
@State private var startCallViewModel: StartCallViewModel?
|
||||||
@State private var callViewModel: CallViewModel?
|
@State private var callViewModel: CallViewModel?
|
||||||
|
|
||||||
|
init() {
|
||||||
|
#if USE_CRASHLYTICS
|
||||||
|
FirebaseApp.configure()
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
var body: some Scene {
|
var body: some Scene {
|
||||||
WindowGroup {
|
WindowGroup {
|
||||||
if coreContext.coreIsStarted {
|
if coreContext.coreIsStarted {
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@ import UIKit
|
||||||
import os
|
import os
|
||||||
import linphonesw
|
import linphonesw
|
||||||
import linphone
|
import linphone
|
||||||
|
#if USE_CRASHLYTICS
|
||||||
|
import Firebase
|
||||||
|
#endif
|
||||||
|
|
||||||
class Log: LoggingServiceDelegate {
|
class Log: LoggingServiceDelegate {
|
||||||
|
|
||||||
|
|
@ -88,6 +91,9 @@ class Log: LoggingServiceDelegate {
|
||||||
} else {
|
} else {
|
||||||
NSLog(log)
|
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) {
|
func onLogMessageWritten(logService: linphonesw.LoggingService, domain: String, level: linphonesw.LogLevel, message: String) {
|
||||||
|
|
|
||||||
10
Podfile
10
Podfile
|
|
@ -9,10 +9,16 @@ def basic_pods
|
||||||
else
|
else
|
||||||
pod 'linphone-sdk', :path => ENV['PODFILE_PATH'] # local sdk
|
pod 'linphone-sdk', :path => ENV['PODFILE_PATH'] # local sdk
|
||||||
end
|
end
|
||||||
|
|
||||||
|
crashlytics
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def crashlytics
|
||||||
|
if not ENV['USE_CRASHLYTICS'].nil?
|
||||||
|
pod 'Firebase/Analytics'
|
||||||
|
pod 'Firebase/Crashlytics'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
target 'Linphone' do
|
target 'Linphone' do
|
||||||
# Comment the next line if you don't want to use dynamic frameworks
|
# Comment the next line if you don't want to use dynamic frameworks
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue