react-native-aliyun-push icon indicating copy to clipboard operation
react-native-aliyun-push copied to clipboard

Feature request: A way to determine wether to display notification or not while app is at foreground

Open drgarbage opened this issue 5 years ago • 0 comments

Feature request

  • Description: Need a way to avoid notification display while app is at foreground.
  • Labels: type: Enhancement

Is your proposal related to a problem?

The original design of native notification handling is silence first, and developer may decide wether to show notification or display directly in his own UI.

When adapting aliyun push service with react-native-aliyun-push, the AliyunPushManager decide wether to show notification or not by checking if content.body is empty, which makes it harder for a messenger app to handle an incoming message notification while user is already in conversation.

Describe the solution you'd like

After receiving the notification from APNS in foreground, while sending event to javascript, ask script to return a boolean value to decide wether to continue to show notification or not.

drgarbage avatar Nov 27 '20 10:11 drgarbage