jpush / jpush/jpush-react-native

Banner not showing on local notifications

Open
#739 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.4k
Forks
348
PR merge metrics
No merged PRs in 30d

Description

Local notification does not display banner when called on android, Only vibrates and adds to the notification centre. (The default priority for android).
https://developer.android.com/training/notify-user/channels#importance

OS: Mac OS Mojave
React-native 0.59.1
jpush-react-native: 2.6.6
Tested on: Huawei nova 2i, mi 9 se

How to escalate the priority of the local notification?

I can see from the Aurora docs that it is possible
"
JPushInterface.EXTRA_NOTI_PRIORITY
Support SDK 3.0.0 or later,and support rom 16 or more.
When the default is 0 and the range is -2 to 2 , other values will be ignored and defaulted.
Notification priority
Bundle bundle = intent.getExtras();
String prio = bundle.getString(JPushInterface.EXTRA_NOTI_PRIORITY);
https://docs.jiguang.cn/en/jpush/client/Android/android_api/
"

I have tried to add in the priority into the extra section without success.
JPush.addLocalNotification({
messageID: "123456789",
title: "testMe",
content: "messageValue",
extras: { priority: '2' }
})

Note: I can trigger the banner by enabling floating notifications through settings. But using other libraries I have been able to trigger the local notification banner without making the user modify their settings.

Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the JPush.addLocalNotification entry point and compare how the React Native plugin passes extras into Android local notifications. Read the linked Android notification-channel and JPush priority documentation first; done means a local notification displays a banner without requiring floating notifications to be enabled in device settings.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.