[notifications] Minor fixes
This commit is contained in:
parent
e6a7004c5d
commit
9255b4be10
@ -1,6 +1,7 @@
|
||||
#import "RNFirebaseNotifications.h"
|
||||
|
||||
#if __has_include(<FirebaseMessaging/FIRMessaging.h>)
|
||||
#import "RNFirebaseEvents.h"
|
||||
#import <React/RCTUtils.h>
|
||||
|
||||
#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
|
||||
@ -372,7 +373,7 @@ RCT_EXPORT_METHOD(scheduleNotification:(NSDictionary*) notification
|
||||
}
|
||||
|
||||
- (NSArray<NSString *> *)supportedEvents {
|
||||
return @[];
|
||||
return @[NOTIFICATIONS_NOTIFICATION_RECEIVED];
|
||||
}
|
||||
|
||||
+ (BOOL)requiresMainQueueSetup
|
||||
|
@ -2,6 +2,7 @@
|
||||
* @flow
|
||||
* Notification representation wrapper
|
||||
*/
|
||||
import { Platform } from 'react-native';
|
||||
import AndroidNotification from './AndroidNotification';
|
||||
import IOSNotification from './IOSNotification';
|
||||
import { generatePushID, isObject } from '../../utils';
|
||||
@ -11,10 +12,10 @@ import type { NativeIOSNotification } from './IOSNotification';
|
||||
import type { Schedule } from './';
|
||||
|
||||
type NativeNotification = {|
|
||||
android: NativeAndroidNotification,
|
||||
android?: NativeAndroidNotification,
|
||||
body: string,
|
||||
data: { [string]: string },
|
||||
ios: NativeIOSNotification,
|
||||
ios?: NativeIOSNotification,
|
||||
notificationId: string,
|
||||
schedule?: Schedule,
|
||||
sound?: string,
|
||||
@ -128,10 +129,10 @@ export default class Notification {
|
||||
}
|
||||
|
||||
return {
|
||||
android: this._android.build(),
|
||||
android: Platform.OS === 'android' ? this._android.build() : undefined,
|
||||
body: this._body,
|
||||
data: this._data,
|
||||
ios: this._ios.build(),
|
||||
ios: Platform.OS === 'ios' ? this._ios.build() : undefined,
|
||||
notificationId: this._notificationId,
|
||||
sound: this._sound,
|
||||
subtitle: this._subtitle,
|
||||
|
Loading…
x
Reference in New Issue
Block a user