RNFIRMessaging.h 1.01 KB
Newer Older
Libin Lu's avatar
init  
Libin Lu committed
1 2 3

#import <UIKit/UIKit.h>

4
#import <FirebaseCore/FIRApp.h>
Libin Lu's avatar
init  
Libin Lu committed
5

Libin Lu's avatar
Libin Lu committed
6
#import <React/RCTBridgeModule.h>
Libin Lu's avatar
init  
Libin Lu committed
7

Libin Lu's avatar
Libin Lu committed
8
@import UserNotifications;
Libin Lu's avatar
init  
Libin Lu committed
9

10
@interface RNFIRMessaging : NSObject <RCTBridgeModule>
Libin Lu's avatar
init  
Libin Lu committed
11

Libin Lu's avatar
Libin Lu committed
12 13 14 15
typedef void (^RCTRemoteNotificationCallback)(UIBackgroundFetchResult result);
typedef void (^RCTWillPresentNotificationCallback)(UNNotificationPresentationOptions result);
typedef void (^RCTNotificationResponseCallback)();

Libin Lu's avatar
init  
Libin Lu committed
16 17
@property (nonatomic, assign) bool connectedToFCM;

Libin Lu's avatar
Libin Lu committed
18
#if !TARGET_OS_TV
Libin Lu's avatar
Libin Lu committed
19
+ (void)didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo fetchCompletionHandler:(nonnull RCTRemoteNotificationCallback)completionHandler;
Libin Lu's avatar
Libin Lu committed
20
+ (void)didReceiveLocalNotification:(nonnull UILocalNotification *)notification;
Libin Lu's avatar
Libin Lu committed
21 22
+ (void)didReceiveNotificationResponse:(nonnull UNNotificationResponse *)response withCompletionHandler:(nonnull RCTNotificationResponseCallback)completionHandler;
+ (void)willPresentNotification:(nonnull UNNotification *)notification withCompletionHandler:(nonnull RCTWillPresentNotificationCallback)completionHandler;
Libin Lu's avatar
Libin Lu committed
23 24
#endif

Libin Lu's avatar
init  
Libin Lu committed
25
@end
26