1

I updated React native OneSignal from 3.2.12 version to 3.3.2 version, after that I started getting an error during app launch.

Here is an error:

RNOneSignal.configure is not a function

"

Here is my code:

import OneSignal from 'react-native-onesignal';

initialize() {
        OneSignal.init(config.oneSignalAppId, {kOSSettingsKeyAutoPrompt : false});
        OneSignal.inFocusDisplaying(0);

        OneSignal.addEventListener('received', this.onReceived);
        OneSignal.addEventListener('opened', this.onOpened);
        OneSignal.addEventListener('ids', this.onIds);

        OneSignal.configure();
    }

How to fix this problem?

UPDATE: I found out that OneSignal code that the configure method has been deprecated.

Lucky_girl
  • 4,543
  • 6
  • 42
  • 82

1 Answers1

2

I removed OneSignal.configure(); from my code, since this method was deprecated and removed configure() from node_modules/react-native-onesignal/index.js and app started work normally after that!

Lucky_girl
  • 4,543
  • 6
  • 42
  • 82
  • I have removed this from my code, but I am getting the same error, and it appears in the stack when I use OneSignal.addEventListener()... any suggestions on where to look for the problem? – 1pocketaces1 Sep 23 '19 at 20:57
  • 1
    Correction: I still had the addEventListener for 'ids' in my code as well. Removing this worked – 1pocketaces1 Sep 23 '19 at 21:25