2017-03-10 14:17:37 +00:00
|
|
|
#import "RNFirebaseCrash.h"
|
|
|
|
|
2017-05-25 15:21:10 +01:00
|
|
|
#if __has_include(<FirebaseCrash/FIRCrashLog.h>)
|
2017-08-17 17:25:51 +01:00
|
|
|
#import <FirebaseCrash/FIRCrashLog.h>
|
2017-03-10 14:17:37 +00:00
|
|
|
|
2017-05-25 15:21:10 +01:00
|
|
|
@implementation RNFirebaseCrash
|
|
|
|
RCT_EXPORT_MODULE();
|
2017-03-10 14:17:37 +00:00
|
|
|
|
2017-05-25 15:21:10 +01:00
|
|
|
RCT_EXPORT_METHOD(log:(NSString *)message) {
|
2017-10-03 10:01:08 +01:00
|
|
|
FIRCrashLog(@"%@", message);
|
2017-03-10 14:17:37 +00:00
|
|
|
}
|
|
|
|
|
2017-05-25 15:21:10 +01:00
|
|
|
RCT_EXPORT_METHOD(logcat:(nonnull NSNumber *) level tag:(NSString *) tag message:(NSString *) message) {
|
2017-10-03 10:01:08 +01:00
|
|
|
FIRCrashLog(@"%@", message);
|
2017-03-10 14:17:37 +00:00
|
|
|
}
|
|
|
|
|
2017-05-25 15:21:10 +01:00
|
|
|
RCT_EXPORT_METHOD(report:(NSString *) message) {
|
2017-10-03 10:01:08 +01:00
|
|
|
FIRCrashLog(@"%@", message);
|
2017-03-10 14:17:37 +00:00
|
|
|
assert(NO);
|
|
|
|
}
|
|
|
|
|
2017-06-12 14:26:56 +01:00
|
|
|
RCT_EXPORT_METHOD(setCrashCollectionEnabled:(BOOL *) enabled) {
|
|
|
|
// Not available yet
|
|
|
|
}
|
|
|
|
|
|
|
|
RCT_EXPORT_METHOD(isCrashCollectionEnabled:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
|
|
|
|
// Not available yet
|
|
|
|
resolve(@YES);
|
|
|
|
}
|
|
|
|
|
2017-03-10 14:17:37 +00:00
|
|
|
@end
|
2017-05-25 15:21:10 +01:00
|
|
|
|
|
|
|
#else
|
|
|
|
@implementation RNFirebaseCrash
|
|
|
|
@end
|
2017-05-31 15:22:15 +01:00
|
|
|
#endif
|