2
0
mirror of synced 2025-01-10 22:26:02 +00:00

[notifications] Minor fixes

This commit is contained in:
Chris Bianca 2018-02-16 09:46:53 +00:00
parent e6a7004c5d
commit 9255b4be10
2 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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,