React Native - Real-time chat/push notifications on PHP/MySQL back-end - reactjs

I am developing my first React Native app and are struggling with the proper implementation of push notifications and real time chat. The attached image shows the current layout without chat/notifications.
The client application uses Firebase only for social network authentication (login) and image storage.
Everything else is kept back-end using PHP/MySQL which also communicates with Firebase for session token validation and email authentication (login).
Now i want to implement a real-time chat function and push notifications but are struggling with the proper way of doing it. If i have understood correctly one way could be: Socket.io (for real-time chat using mysql for archive storage) and Onesignal (for push notifications)
Or is there a better way of doing this when using a PHP/MySQL as back-end?
Any ideas or input is greatly appriciated.

Related

Application that receives data in real time without refresh

I am developing a desktop program, a website and an application and they both communicate through the same database. I started researching about making these apps real-time, that I don't need to update to receive a new registration or a change to something. I discovered websockets and socket.io, saw some examples and read a lot about it, but then I saw that there are some databases that already do this and one of the most famous is firebase. What I would like to ask here is, using firebase can I make an application in real time? An application that when registering data to the database, all other connected applications receive this data in real time?
In google firebase, you can create listeners on the client-side to respond to any changes in the backend. Check out https://firebase.google.com/docs/firestore/query-data/listen.
This is great if you need to store data, but if you are purely looking to send information between clients and there is no need for any persistence, I would recommend using WebSockets.

Incluiding payment systems in a ReactJS/Firebase app

I'm currently developing a ReactJS & Firebase app, but I'm facing the following problem:
As all the code is run in the client side, how can I connect to the payment API without exposing my private token?
I was thinking on creating a Google Cloud Function that could handle this requests. I think this functions should manage maybe a sign in to get the token, and later request the payments. Should this work?
Right now Google Cloud Functions isn't free to make requests out of a Google app. Does someone know how could I avoid the $25/month?
Another alternative I was thinking on was creating a Rails API on Heroku to manage only this requests, but I'm not sure if I'm not exposing the tokens by managing the logic on the front side. (Because the front end would have to talk to Firebase and this new API)
Security is a must.
Thanks!

How to use API as backend in ionic mobile app development?

I am having a web application built using JAVA spring which has API feature to read and write into database.
Now i have to develop an ionic mobile app for the same application. How to read and write data into database.
I know Firebase and other alternatives can do the job.
But i need my own API code(written for web app) to be used. Is there any way to achieve that?
I guess calling the respective API when the web application is live is achievable.
But how can i achieve that while developing(When the web app is under construction)
Well depending on how you set up the API this could become quite difficult.
You're saying/guessing that you can call the API when the webapplication is live. This makes me assume you've created a REST API? Or did you create a Spring MVC application?
If the webapplication is directly linked to your Spring application (f.e. going to localhost:8080/my-profile shows a page (not JSON) of your profile) then I'm not sure if you can achieve the above mentioned target.
If you get a JSON response, or are somehow able to retrieve it from the webpage, you can just simply call (in typescript:)
this.http.get('http://localhost:8080/my-profile').map(response => console.log(response.json() );
Else, you probably will have to create a basic REST API (check out Spring boot for a 5 minute setup) and provide it, either with hardcoded data or connect it with your database.

Sending Push Notifications to Firebase Users in AngularJS app (no server code)

I have an AngularJS app with no server code. I created a form in which I'd like to be able to type a message and send as a push notification to all Firebase users using our mobile app. I've looked at Firebase Cloud Messaging and services such as OneSignal, however, both strongly advise against sending push notifications via client for security reasons.
Has anyone been able do something like this? Any suggestions are appreciated. I'm not attached to any method besides the ones that work well and securely.
Thank you.

how to get data from moble app into web app

I have designed my web app using mvc and designed the web api's to send the data to the mobile app in the form of json. I want to understand what to do, if a user registered on the mobile app,I (as the server side) should be able to get this data and save it into my database (again server side) so that the user can access from web app as well with the same credentials.how could that happen? I mean should I design a web api to receive data from the mobile party?I hope my question is not dump or silly or asked wrong because I'm trying to learn and understand. I really would like some explanation.

Resources