diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 577db8a4f..ba1cc27d1 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -31,7 +31,7 @@ #include "LinphoneManager.h" #include "linphone/linphonecore.h" -#ifdef USE_CRASHLYTHICSS +#ifdef USE_CRASHLYTHICS #include "FIRApp.h" #endif @@ -252,7 +252,7 @@ #pragma deploymate pop - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { -#ifdef USE_CRASHLYTHICSS +#ifdef USE_CRASHLYTHICS [FIRApp configure]; #endif diff --git a/Classes/Utils/Log.m b/Classes/Utils/Log.m index dfbecaab5..2f366df70 100644 --- a/Classes/Utils/Log.m +++ b/Classes/Utils/Log.m @@ -21,8 +21,8 @@ #import #import -#ifdef USE_CRASHLYTHICSS -#import +#ifdef USE_CRASHLYTHICS +@import FirebaseCrashlytics; #endif @implementation Log @@ -106,20 +106,17 @@ void linphone_iphone_log_handler(const char *domain, OrtpLogLevel lev, const cha for (int i = 0; i < myWords.count; i++) { NSString *tab = i > 0 ? @"\t" : @""; if (((NSString *)myWords[i]).length > 0) { -#ifdef USE_CRASHLYTHICSS - CLSNSLog(@"[%@] %@%@", lvl, tab, (NSString *)myWords[i]); -#else - NSLog(@"[%@] %@%@", lvl, tab, (NSString *)myWords[i]); +#ifdef USE_CRASHLYTHICS + [[FIRCrashlytics crashlytics] logWithFormat:@"[%@] %@%@", lvl, tab, (NSString *)myWords[i]]; #endif - + NSLog(@"[%@] %@%@", lvl, tab, (NSString *)myWords[i]); } } } else { -#ifdef USE_CRASHLYTHICSS - CLSNSLog(@"[%@] %@", lvl, [formatedString stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\n"]); -#else - NSLog(@"[%@] %@", lvl, [formatedString stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\n"]); +#ifdef USE_CRASHLYTHICS + [[FIRCrashlytics crashlytics] logWithFormat:@"[%@] %@", lvl, [formatedString stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\n"]]; #endif + NSLog(@"[%@] %@", lvl, [formatedString stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\n"]); } } diff --git a/Podfile b/Podfile index 11753a89d..3a1ddfaaf 100644 --- a/Podfile +++ b/Podfile @@ -25,14 +25,8 @@ end def crashlythics if not ENV['USE_CRASHLYTHICS'].nil? - # Add the Firebase pod for Google Analytics pod 'Firebase/Analytics' - pod 'Crashlytics', '~> 3.4.1' - - # Add the pods for any other Firebase products you want to use in your app - # For example, to use Firebase Authentication and Cloud Firestore - pod 'Firebase/Auth' - pod 'Firebase/Firestore' + pod 'Firebase/Crashlytics' end end @@ -96,9 +90,9 @@ post_install do |installer| else # activate crashlythics if config.name == "Debug" then - config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) DEBUG=1 USE_CRASHLYTHICSS=1' + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) DEBUG=1 USE_CRASHLYTHICS=1' else - config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) USE_CRASHLYTHICSS=1' + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) USE_CRASHLYTHICS=1' end end diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 3eb960bc3..10bd89b50 100644 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -4005,6 +4005,8 @@ inputFileListPaths = ( ); inputPaths = ( + "$(SRCROOT)/linphone.xcarchive/dSYMs/linphone.app.dSYM/Contents/Resources/DWARF/linphone", + "$(SRCROOT)/linphone-Info.plist", ); outputFileListPaths = ( ); @@ -4012,7 +4014,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if USE_CRASHLYTHICS; then\n ${PODS_ROOT}/Fabric/run\nfi\n"; + shellScript = "val=`expr \"$GCC_PREPROCESSOR_DEFINITIONS\" : \".*USE_CRASHLYTHICS=\\([0-9]*\\)\"`\nif [ $val = 1 ]; then\n ${PODS_ROOT}/FirebaseCrashlytics/run\nfi\n\n\n"; }; 63DCC71D1A07B08E00916627 /* Run Script */ = { isa = PBXShellScriptBuildPhase;