React-native-push-notification: TypeError: RNPushNotification.getInitialNotification is not a function

Created on 19 Jul 2016  路  12Comments  路  Source: zo0r/react-native-push-notification

Hi guys,

I'm having some issues, before update to 2.0.1 I was able to call PushNotification.configure from componentWillMount lifecycle method, but now it throws a warning and the app do not load (white screen).

screen shot 2016-07-19 at 3 13 06 pm

Here's the code:

import PushNotification from 'react-native-push-notification'

module.exports = React.createClass({
    componentWillMount() {
        PushNotification.configure({
            onNotification: function(notification) {
                console.log(notification)
            },
        })
    },
    ...
})

Any idea what could be the problem?

Most helpful comment

I have the same problem, using android 6.0
"react-native": "0.49.3",
"react-native-push-notification": "^3.0.1"
any solution?

All 12 comments

Confirmed @zo0r, I just downgrade to 2.0.0 and the code works, what going on?

@frangeris what version of RN are you using? Android or iOS?

"react": "^15.2.1"
"react-native": "^0.29.0"

Android 4.2.2

@frangeris I can't replicate the error, please try restarting the react-native packager and re-compile the project.

Yeah, it seems was catching something.

rm -rf node_modules/
npm i
npm start -- --reset-cache
react-native run-android

Running the above solved the issue.

I'm seeing this same error, and was unable to solve it with @frangeris solution. I have followed all the requisite steps from the troubleshooting steps. Any Ideas?

Turns out react-native link doesn't seem to do the android side, so I had to follow the manual installation instructions.

and I have the same problem

I have the same problem, using android 6.0
"react-native": "0.49.3",
"react-native-push-notification": "^3.0.1"
any solution?

Getting same error on latest version

I have the same problem, using android 6.0
"react-native": "0.49.3",
"react-native-push-notification": "^3.0.1"

I am using Android.
any solution?

TypeError: RNPushNotification.getInitialNotification is not a function
I am implemented this with Expo ,is this working with Expo Applications?
I have the same problem, using Android 10
"react-native-push-notification": "^3.0.1"
I am using Android 10
any solution?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

uendar picture uendar  路  3Comments

edwinharly picture edwinharly  路  3Comments

Benzer1406 picture Benzer1406  路  3Comments

anativ picture anativ  路  3Comments

ssolida picture ssolida  路  3Comments