react-native-push-notification: Can't configure senderID in example app

Bug

Hello. I was struggling configure the pushNotification plugin in my own application so I decided to check if it was working on the example app

Onde I launched it I tried localNotifications, working fine. However I wanted to try a remote notification (what i want to do in my own app as well) and filled in the input to configure my FCM senderID. Seems the app crash at this step when I click the button. I investigated a bit and it seems to come from the onRegister function but I can’t find what cause the problem exactly. I recently updated the package from 3.1.9 to 3.2.1 and since then it doesn’t work anymore. The steps to configure the PushNotifications plugins were working fine in 3.1.9, I could register and receiver notifications as expected

Any idea ?

Environment info

react-native info output:

 System:
    OS: macOS 10.15.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 241.64 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 13.10.1 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6308749
    Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_242 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0
    react-native: 0.62.2 => 0.62.2

Library version: 3.2.1

Steps To Reproduce

  1. git clone https://github.com/zo0r/react-native-push-notification.git
  2. cd example
  3. npm install
  4. npx react-native run-android (I had to refactor the android project to AndroidX in android studio to make it work)
  5. configure the FCM senderID in app

Describe what you expected to happen:

  1. Except the example app not to crash

Reproducible sample code

About this issue

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

Most upvoted comments

Cool ! If something is missing on the README feel free to update 😉 I will check tomorrow

Hi @riamon-v File google-services.json is missing. The Google Services Plugin cannot function without it.

Yeah sorry, I just figured this out

Hi @riamon-v File google-services.json is missing. The Google Services Plugin cannot function without it.