mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-24 04:24:52 +08:00
[ios][notifications] Handle messaging token refreshed before bridge initialised #960
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
* @flow
|
||||
* Messaging (FCM) representation wrapper
|
||||
*/
|
||||
import { Platform } from 'react-native';
|
||||
import { SharedEventEmitter } from '../../utils/events';
|
||||
import INTERNALS from '../../utils/internals';
|
||||
import { getLogger } from '../../utils/log';
|
||||
@@ -63,6 +64,11 @@ export default class Messaging extends ModuleBase {
|
||||
SharedEventEmitter.emit('onTokenRefresh', token);
|
||||
}
|
||||
);
|
||||
|
||||
// Tell the native module that we're ready to receive events
|
||||
if (Platform.OS === 'ios') {
|
||||
getNativeModule(this).jsInitialised();
|
||||
}
|
||||
}
|
||||
|
||||
getToken(): Promise<string> {
|
||||
|
||||
Reference in New Issue
Block a user