react-native-aliyun-push
react-native-aliyun-push copied to clipboard
Feature request: A way to determine wether to display notification or not while app is at foreground
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.