question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: RNPushNotification.getInitialNotification is not a function

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
ahsanshibghotullahcommented, Oct 20, 2017

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

1reaction
sargamvermacommented, Jul 1, 2020

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-push-notification is undefined - Stack Overflow
Its all working on iOS but on android I get undefined is not an object(evaluating RNPushnotification.getInitialNotifications).
Read more >
cljsrn 2022-01-29 - Slack Archive
Could not evaluate form: (function (){try{return ... [TypeError: null is not an object (evaluating 'RNPushNotification.
Read more >
Discussion of React Native Push Notifications
getInitialNotification() , in order to get the initial notification on iOS. ... typeError null:null is not an object evaluating.this.
Read more >
react-native-push-notification - npm
java ensure that function includes a super call on onNewIntent (if your MainActivity.java does not have an @Override for onNewIntent skip this):.
Read more >
messaging | React Native Firebase
getInitialNotification (): Promise<RemoteMessage | null>;. getIsHeadless. </>. Returns whether the root view is headless or not i.e true if the app was ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found