Commit 5a43b837 authored by DanmeiChen's avatar DanmeiChen

disable crashlythics by default

parent 652bed7b
......@@ -30,7 +30,10 @@
#include "LinphoneManager.h"
#include "linphone/linphonecore.h"
#ifdef USE_CRASHLYTHICSS
#include "FIRApp.h"
#endif
@implementation LinphoneAppDelegate
......@@ -234,7 +237,7 @@
#pragma deploymate pop
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
#ifdef USE_FIREBASE
#ifdef USE_CRASHLYTHICSS
NSString *pathForFile=[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"GoogleService-Info.plist"];
if ([[NSFileManager defaultManager] fileExistsAtPath:pathForFile]){
// If GoogleService-Info.plist doesn't exist, not call this function avoiding a crash.
......
......@@ -20,17 +20,15 @@
#import "Log.h"
#import <asl.h>
#import <os/log.h>
#ifdef USE_CRASHLYTHICSS
#import <Crashlytics/Crashlytics.h>
#endif
@implementation Log
#define FILE_SIZE 17
#define DOMAIN_SIZE 3
#ifdef USE_FIREBASE
#define USE_CRASHLYTICS TRUE
#else
#define USE_CRASHLYTICS FALSE
#endif
+ (NSString *)cacheDirectory {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
......@@ -120,20 +118,20 @@ 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) {
if (USE_CRASHLYTICS) {
CLSNSLog(@"[%@] %@%@", lvl, tab, (NSString *)myWords[i]);
} else {
NSLog(@"[%@] %@%@", lvl, tab, (NSString *)myWords[i]);
}
#ifdef USE_CRASHLYTHICSS
CLSNSLog(@"[%@] %@%@", lvl, tab, (NSString *)myWords[i]);
#else
NSLog(@"[%@] %@%@", lvl, tab, (NSString *)myWords[i]);
#endif
}
}
} else {
if (USE_CRASHLYTICS) {
CLSNSLog(@"[%@] %@", lvl, [formatedString stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\n"]);
} else {
NSLog(@"[%@] %@", lvl, [formatedString stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\n"]);
}
#ifdef USE_CRASHLYTHICSS
CLSNSLog(@"[%@] %@", lvl, [formatedString stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\n"]);
#else
NSLog(@"[%@] %@", lvl, [formatedString stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\n"]);
#endif
}
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AD_UNIT_ID_FOR_BANNER_TEST</key>
<string></string>
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
<string></string>
<key>CLIENT_ID</key>
<string></string>
<key>REVERSED_CLIENT_ID</key>
<string></string>
<key>API_KEY</key>
<string></string>
<key>GCM_SENDER_ID</key>
<string></string>
<key>BUNDLE_ID</key>
<string></string>
<key>PROJECT_ID</key>
<string></string>
<key>STORAGE_BUCKET</key>
<string></string>
</dict>
</plist>
......@@ -10,10 +10,13 @@ def basic_pods
pod 'linphone-sdk', :path => ENV['PODFILE_PATH'] # loacl sdk
end
pod 'Firebase/Core'
pod 'Fabric', '~> 1.9.0'
pod 'Crashlytics', '~> 3.12.0'
pod 'Firebase/Performance'
if not ENV['USE_CRASHLYTHICS'].nil?
# activate crashlythics
pod 'Firebase/Core'
pod 'Fabric', '~> 1.9.0'
pod 'Crashlytics', '~> 3.12.0'
pod 'Firebase/Performance'
end
end
target 'latestCallsWidget' do
......@@ -75,3 +78,20 @@ target 'richNotifications' do
# Pods for richNotifications
end
post_install do |installer|
app_project = Xcodeproj::Project.open(Dir.glob("*.xcodeproj")[0])
app_project.native_targets.each do |target|
if target.name == 'linphone'
target.build_configurations.each do |config|
if ENV['USE_CRASHLYTHICS'].nil?
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) DEBUG=1'
else
# activate crashlythics
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) DEBUG=1 USE_CRASHLYTHICSS=1'
end
app_project.save
end
end
end
end
......@@ -88,6 +88,22 @@ See: https://developer.apple.com/library/archive/documentation/DeveloperTools/Co
-Then open linphone.xcworkspace (instead of linphone.xcodeproj) to install the app.
# Use crashlythics
We've integrated the crashlythics into liphone-iphone, which can automatically send us a crash report. It is disabled by default.
To activate it :
-Download GoogleService-Info.plist from :
https://console.firebase.google.com/project/linphone-iphone/settings/general/ios:org.linphone.phone
You may not have access to this website because it is restricted to certain developers.
-Replace GoogleService-Info.plist for this project with the file you downloaded.
-Rebuild the project:
* USE_CRASHLYTHICS=true pod install
-Then open linphone.xcworkspace (instead of linphone.xcodeproj) to install the app.
# Quick UI reference
- The app is contained in a window, which resides in the MainStoryboard file.
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment