RNFIRMessaging.h 1.09 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
Libin Lu committed
5
#import <FirebaseMessaging/FirebaseMessaging.h>
Libin Lu's avatar
init  
Libin Lu committed
6

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

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

Libin Lu's avatar
Libin Lu committed
11
@interface RNFIRMessaging : RCTEventEmitter <RCTBridgeModule, FIRMessagingDelegate>
Libin Lu's avatar
init  
Libin Lu committed
12

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

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

Libin Lu's avatar
Libin Lu committed
19
#if !TARGET_OS_TV
Libin Lu's avatar
Libin Lu committed
20
+ (void)didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo fetchCompletionHandler:(nonnull RCTRemoteNotificationCallback)completionHandler;
Libin Lu's avatar
Libin Lu committed
21
+ (void)didReceiveLocalNotification:(nonnull UILocalNotification *)notification;
Libin Lu's avatar
Libin Lu committed
22 23
+ (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
24 25
#endif

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