2017-03-10 14:17:37 +00:00
|
|
|
#import "RNFirebaseCrash.h"
|
|
|
|
|
2017-05-25 14:21:10 +00:00
|
|
|
#if __has_include(<FirebaseCrash/FIRCrashLog.h>)
|
|
|
|
#import "FirebaseCrash/FIRCrashLog.h"
|
2017-03-10 14:17:37 +00:00
|
|
|
|
2017-05-25 14:21:10 +00:00
|
|
|
@implementation RNFirebaseCrash
|
|
|
|
RCT_EXPORT_MODULE();
|
2017-03-10 14:17:37 +00:00
|
|
|
|
2017-05-25 14:21:10 +00:00
|
|
|
RCT_EXPORT_METHOD(log:(NSString *)message) {
|
2017-03-10 14:17:37 +00:00
|
|
|
FIRCrashLog(message);
|
|
|
|
}
|
|
|
|
|
2017-05-25 14:21:10 +00:00
|
|
|
RCT_EXPORT_METHOD(logcat:(nonnull NSNumber *) level tag:(NSString *) tag message:(NSString *) message) {
|
2017-03-10 14:17:37 +00:00
|
|
|
FIRCrashLog(message);
|
|
|
|
}
|
|
|
|
|
2017-05-25 14:21:10 +00:00
|
|
|
RCT_EXPORT_METHOD(report:(NSString *) message) {
|
2017-03-10 14:17:37 +00:00
|
|
|
FIRCrashLog(message);
|
|
|
|
assert(NO);
|
|
|
|
}
|
|
|
|
|
2017-06-12 13:26:56 +00: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 14:21:10 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
@implementation RNFirebaseCrash
|
|
|
|
@end
|
2017-05-31 14:22:15 +00:00
|
|
|
#endif
|