2018-02-02 08:40:48 +00:00
|
|
|
#import "RNFirebaseNotifications.h"
|
|
|
|
|
|
|
|
#if __has_include(<FirebaseMessaging/FIRMessaging.h>)
|
|
|
|
|
|
|
|
@implementation RNFirebaseNotifications
|
|
|
|
RCT_EXPORT_MODULE();
|
|
|
|
|
2018-02-02 12:05:51 +00:00
|
|
|
RCT_EXPORT_METHOD(getInitialNotification:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject){
|
|
|
|
UILocalNotification *localUserInfo = [self bridge].launchOptions[UIApplicationLaunchOptionsLocalNotificationKey];
|
|
|
|
if (localUserInfo) {
|
|
|
|
// TODO: Proper format
|
|
|
|
resolve([[localUserInfo userInfo] copy]);
|
|
|
|
} else {
|
|
|
|
resolve(nil);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSArray<NSString *> *)supportedEvents {
|
|
|
|
return @[];
|
|
|
|
}
|
|
|
|
|
|
|
|
+ (BOOL)requiresMainQueueSetup
|
|
|
|
{
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
2018-02-02 08:40:48 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
#else
|
|
|
|
@implementation RNFirebaseNotifications
|
|
|
|
@end
|
|
|
|
#endif
|
|
|
|
|