Please provide the following:
- SDK Version: 38.00
- Platforms(Android/iOS/web/all): Android / IOS
m developing a react native project in Expo, and the app is pretty much done for all the functionality. However, im stuck on the last part which is push notifications.
We have the following assets:
Laravel web app with API ( Passport ) https://teetimesaver.com/
React Native expo app
In the admin of the web app we can change order status from pending to confirmed. Once we trigger the order to be confirmed, we want to sent out a push notification to their mobile phone, so that they can pay for the order.
The thing is, the web app and the phone app use the same database, the phone app is just consuming data from the api. And the laravel database is a conventional relational database, we got no realtime database like firebase.
With a system like firebase we can listen to the state, and if it change we can execute something. But as i understand this is not possible with a normal database right?
And even if it is possible, if there is no listener how can this be detected by the phone app?
If i send a notification based on just the order status, it would keep sending notifications as the status is always confirmed. So this parameter alone would not work.
I was thinking on putting an extra field in the orders table called “sendPushNotification” with a initial value of 0, then when the order is confirmed change this to 1, and when the notification is send out put it back to 0. Where the notification will only be send if the value is 1.
However, then we come back to the other issue of not having a constant listener for that change.
Can anyone help me with a push in the right direction? I`m a bit lost on this.