|
|
|
|
5
|
export class NativeEventsReceiver {
|
5
|
export class NativeEventsReceiver {
|
6
|
private emitter;
|
6
|
private emitter;
|
7
|
constructor() {
|
7
|
constructor() {
|
8
|
- if (NativeModules.RNNEventEmitter) {
|
|
|
|
|
8
|
+ try {
|
9
|
this.emitter = new NativeEventEmitter(NativeModules.RNNEventEmitter);
|
9
|
this.emitter = new NativeEventEmitter(NativeModules.RNNEventEmitter);
|
10
|
- } else {
|
|
|
|
|
10
|
+ } catch (e) {
|
11
|
console.log('Using mock NativeEventEmitter module');
|
11
|
console.log('Using mock NativeEventEmitter module');
|
12
|
this.emitter = {
|
12
|
this.emitter = {
|
13
|
addListener: () => {
|
13
|
addListener: () => {
|