wix / react-native-notifications

React Native Notifications
MIT License
3.24k stars 763 forks source link

React Native - Silent Notification #690

Closed ankitaptagline closed 3 years ago

ankitaptagline commented 3 years ago

Hello there, I am using your library for the notification. I have setup with Firebase notifications. Requirements of the notification are I don't want to see the multiple same types of notification to my notification tray.

I have tried as per your documentation, https://wix.github.io/react-native-notifications/docs/localNotifications/

I tried to remove the notification from the notification bar with Notifications.ios.removeDeliveredNotifications([notificationId]): (But not working)

I have reviewed the Silent Notification concept. But I am not able to receive the Silent notification event from this package. Can you please help me to get the Silent Push notification response from the Application side? (For Foreground, Background and Terminated State)

Here I am attaching some responses and some piece of code, please review. Apply this with the Local Notification, 1. aps: { "content-available": 1, sound: "", }, 2. aps: { "content-available": 1, sound: "", }, priority: "high" 3. apns: { headers: { "apns-collapse-id": "post123", "collpase_key": "post123" } }, priority: "high"

When I fired server-side silent notification then I received this type of response, {:body=>\"{\\"multicast_id\\":2478128392942193980,\\"success\\":1,\\"failure\\":0,\\"canonical_ids\\":0,\\"results\\":[{\\"error\\":\\"InvalidRegistration\\"}]}\", :headers=>{\"content-type\"=>[\"application/json; charset=UTF-8\"], \"date\"=>[\"Sat, 17 Oct 2020 08:15:53 GMT\"], \"expires\"=>[\"Sat, 17 Oct 2020 08:15:53 GMT\"], \"cache-control\"=>[\"private, max-age=0\"], \"x-content-type-options\"=>[\"nosniff\"], \"x-frame-options\"=>[\"SAMEORIGIN\"], \"content-security-policy\"=>[\"frame-ancestors 'self'\"], \"x-xss-protection\"=>[\"1; mode=block\"], \"server\"=>[\"GSE\"], \"alt-svc\"=>[\"h3-Q050=\\":443\\"; ma=2592000,h3-29=\\":443\\"; ma=2592000,h3-27=\\":443\\"; ma=2592000,h3-T051=\\":443\\"; ma=2592000,h3-T050=\\":443\\"; ma=2592000,h3-Q046=\\":443\\"; ma=2592000,h3-Q043=\\":443\\"; ma=2592000,quic=\\":443\\"; ma=2592000; v=\\"46,43\\"\"], \"accept-ranges\"=>[\"none\"], \"vary\"=>[\"Accept-Encoding\"], \"connection\"=>[\"close\"], \"transfer-encoding\"=>[\"chunked\"]}, :status_code=>200, :response=>\"success\", :canonical_ids=>[], :not_registered_ids=>[]}

Looking forward to your response, Thanks.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 3 years ago

The issue has been closed for inactivity.