[ios][crash] now detects if pod installed (makes the pod an optional dependency)

This commit is contained in:
Salakar 2017-05-25 15:21:10 +01:00
parent 531acece76
commit 6e167736b6
3 changed files with 15 additions and 13 deletions

View File

@ -1,5 +1,4 @@
#import "RNFirebaseAuth.h"
#import "RNFirebaseErrors.h"
#import "RNFirebaseEvents.h"
@implementation RNFirebaseAuth

View File

@ -1,26 +1,29 @@
#import "RNFirebaseCrash.h"
#import "Firebase.h"
#if __has_include(<FirebaseCrash/FIRCrashLog.h>)
#import "FirebaseCrash/FIRCrashLog.h"
@implementation RNFirebaseCrash
RCT_EXPORT_MODULE();
RCT_EXPORT_MODULE(RNFirebaseCrash);
RCT_EXPORT_METHOD(log:(NSString *)message)
{
RCT_EXPORT_METHOD(log:(NSString *)message) {
FIRCrashLog(message);
}
RCT_EXPORT_METHOD(logcat:(nonnull NSNumber *) level
tag:(NSString *) tag
message:(NSString *) message)
{
RCT_EXPORT_METHOD(logcat:(nonnull NSNumber *) level tag:(NSString *) tag message:(NSString *) message) {
FIRCrashLog(message);
}
RCT_EXPORT_METHOD(report:(NSString *) message)
{
RCT_EXPORT_METHOD(report:(NSString *) message) {
FIRCrashLog(message);
assert(NO);
}
@end
#else
@implementation RNFirebaseCrash
RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD(nativeSDKMissing) {}
@end
#endif

View File

@ -280,7 +280,7 @@ RCT_EXPORT_METHOD(putFile:(NSString *) path localPath:(NSString *)localPath meta
PHVideoRequestOptions *options = [PHVideoRequestOptions new];
options.networkAccessAllowed = true;
[[PHImageManager defaultManager] requestExportSessionForVideo:asset options:options exportPreset:AVAssetExportPresetHighestQuality resultHandler:^(AVAssetExportSession * _Nullable exportSession, NSDictionary * _Nullable info) {
if ([info objectForKey:PHImageErrorKey] == nil) {
if (info[PHImageErrorKey] == nil) {
NSURL *tempUrl = [self temporaryFileUrl];
exportSession.outputURL = tempUrl;