mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-28 20:25:41 +08:00
[ios] Tidy up of iOS imports and other misc clean up
This commit is contained in:
@@ -1,36 +1,18 @@
|
||||
#import "RNFirebase.h"
|
||||
#import "RNFirebaseEvents.h"
|
||||
|
||||
static dispatch_once_t onceToken;
|
||||
|
||||
@implementation RNFirebase
|
||||
RCT_EXPORT_MODULE(RNFirebase);
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
NSLog(@"Dealloc called on RNFirebase: %@", self);
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
NSLog(@"Setting up RNFirebase instance");
|
||||
[RNFirebase initializeRNFirebase];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (void)initializeRNFirebase {
|
||||
#if __has_include(<FirebaseMessaging/FirebaseMessaging.h>)
|
||||
dispatch_once(&onceToken, ^{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kRNFirebaseInitialized object:nil];
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
- (NSArray<NSString *> *)supportedEvents {
|
||||
return @[INITIALIZED_EVENT];
|
||||
return @[];
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user