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.

Remote notifications message is null when payload uses body_loc_key in foreground

See original GitHub issue

Bug

This is a bug on Android.

I have an issue when trying to internationalize my notifications messages using the body_loc_key parameter See table 2.b

When the app is in foreground the notification message property is null. In background the notification will display properly and show the value of the resources string.

Using the body parameter will properly work in background and foreground (message is the body value)

Environment info

"react-native-push-notification": "^7.0.0",

react-native info output:

info Fetching system and libraries information...
(node:22905) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
System:
    OS: macOS 11.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 462.41 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.15.1 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.8 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.0 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.3, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      API Levels: 28, 29
      Build Tools: 28.0.3, 29.0.2, 29.0.3
      System Images: android-R | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.6953283
    Xcode: 12.3/12C33 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_222 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.4 => 0.63.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found```

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Dallas62commented, Jan 24, 2021

Hi @plus- Your patch has been tested and released 😉 (#1837) Thanks for your report and contribution ! Regards

0reactions
Dallas62commented, Jan 20, 2021

Thanks for the PR,

If you have your project, you can apply your change directly in the node_modules, it’s not perfect but it’s help to test 😉

I will look this weekend and release it ASAP.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remote notification payload is null - ios - Stack Overflow
I've used NSLog to log the payload and its showing that it is null. Is there any reason it would be null? I...
Read more >
Push Notification Events | SAP Help Portal
Triggered when a notification is delivered to a foreground application. The notification title, body and payload are exposed to you as part of...
Read more >
Receive messages in an Android app - Firebase - Google
Messages with both notification and data payload, when received in the background. In this case, the notification is delivered to the device's system...
Read more >
Payload Key Reference - Apple Developer
Describes how apps can send and receive user notifications locally and remotely.
Read more >
Cloud Messaging | FlutterFire
Each message payload can be up to 4 KB in size, containing pre-defined or custom data to suit your applications requirements. Common use-cases...
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