customerio / customerio-reactnative

MIT License
23 stars 11 forks source link

How to read Push notification payload and silent/background notification payload #110

Closed beqramo closed 1 year ago

beqramo commented 1 year ago

I'm trying to integrate customer.io but I can't see any listeners for the above events, which is crucial for our application to work.

can you tell me a roadmap or docs link if I'm missing something?

Thank you

mrehan27 commented 1 year ago

Hi @beqramo Thanks for sharing. Unfortunately, notification listeners are not yet available. We have this in our roadmap and I can add your vote to the issue so you’re notified when it’s available.

beqramo commented 1 year ago

Hi @mrehan27, As I see you added listeners. But now the question is if I can send a silent notification from customer.io. just to give you more info about the flow: There are some processes that take some time so we can't have a request open till BE returns the response, So we want to use silent notifications to give the app info about the status of the process.

As another question, it will work if the user didn't give the notification permission? is there any way that We can use in-app messages for the above scenario?

image
mrehan27 commented 1 year ago

Hi @beqramo, thanks for explaining the use case. Unfortunately, our SDK doesn't yet provide callbacks for listening on notifications received. If you are looking to receive silent notifications and take some action on receiving them, you can write native code in your app to support this, or alternatively, add another messaging SDK that works with Firebase and provides these callbacks, e.g. react-native-firebase/messaging does provide callbacks for such use cases. Also, if you add any other messaging SDK, you will need to use the methods you shared above as explained in our docs so Customer.io SDK can process the notifications for you.

Will it work if the user didn't give the notification permission?

Yes, notification permission is only required for displaying notifications on device. You can still receive silent notifications even if user has denied the permission.

Is there any way that We can use in-app messages for the above scenario?

Unfortunately no, Customer.io SDK doesn't really provide options for this. In-app messages are used for displaying banners when app is visible and can't really help in this case.

beqramo commented 1 year ago

thanks for your full answer. closing this issue.