Notification push using strapi and react native

Hi, I’m developing an application using react native, and I’m going to deal with the push notifications. So I was looking for some information and tutorials but there is none ressources about sending notifications push using strapi, all the ressources are with th following stack : “Expo + firebase + React Native”. So I have some questions :slightly_smiling_face:

Is it possible to send push notifications using strapi ?

Do I have to do somthing inside strapi if (for example) I want to send an notification every time I add an article in my strapi backend ?

thank you for helping :wink:

You could use a push notification library and execute the push using the afterCreate / afterUpdate lifecycle callbacks detailed here:

Hey thank you so much for your awnser, have you a library in mind ?
I’m gonna check this, by chance do you have any example ?
(Si if I understand I don’t need to use firebase ?)

Is it almost the same thing as if I want to send Email ?

I’m sorry I don’t have any in mind or any examples on hand.

I would imagine so, those lifecycles are just executed after something has been fetched, updated, created, or deleted from the database so it makes sense to be the perfect place to send a notification.

1 Like

Hi @Gabriel_Eliade, did you find a solution in the end? I’m also looking for a solutions right now for my Strapi project…

1 Like

hi sorry for the delay, my advice it’s to use Onesignal or firebase messaging

1 Like

Thanks! I managed to figure out using the Strapi REST APIs, as I didn’t need a realtime database.

How did you managed it?

Unfortunately, right now the GraphQL plugin does not support subscriptions, what would be the best way to do this.

For notifications using REST API, see this

Architecturally talking: what does perform better: push notifications or socket io?

We integrated Firebase Cloud Messaging with Strapi core controllers (override Create and Update) and send Firebase push notifications any time a new article is created or updated.