react-native-notifications: [V3.0.0][ANDROID] TypeError: null is not an object (evaluating 'this.nativeCommandsModule.refreshToken')

as the title said. I am using the newest version of the module on Android. but I got this error when calling Notifications.registerRemoteNotifications

The error is: TypeError: null is not an object (evaluating 'this.nativeCommandsModule.refreshToken')

My package.json

"react": "16.9.0",
"react-native": "0.61.2",
"react-native-notifications": "^3.0.0",

Please fix the problem! I really appreciate it!!!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22

Most upvoted comments

Hmm… Im not too sure. I forgot to add this part and after adding it, it worked for me.

In MainApplication.java

import com.wix.reactnativenotifications.RNNotificationsPackage;

protected List<ReactPackage> getPackages() {
  ...
  packages.add(new RNNotificationsPackage(MainApplication.this));
  return packages;
}

Wow! thanks so much! I was adding that line, but not right. So stupid…

You save my day, making me see that concrete line carefully. Thanks a lot!

Confirmed that the problem is about linking