Send data from server to specific user app


Right now I’ve my application server and two ionic 2 applications (for android), one that represents the Physician and other that represents the Patient. I need that the Physician calls the Patient to its consultation room whenever the physician wants. So, I was thinking:
1 - The app Physician sends info about the user to the server (in a HTTP POST) (until here its all good);
2 - The server receives it and sends a message or a notification to the respective user.

My questions are:
How can I identify my app Patient accordingly to each user?? IP?? Is there any url associated with each app?
What I want to do is somehow possible?

It would be better if I create a socket between my two apps. Again, how do I identify the app?

thanks in advance :slight_smile:

You need the user represented in the backend with e.g. a user_id and push notifications in the patient app.

The physician sees a list of patients, selects one to come in. The app tells the backend that user_id=x can come. In the backend the script gets the Push-Token (also called “registration ID” or similar) of the user_id (this was transmitted from the patient app to the backend with the user_id when it registered for push) and send a push to the app of the user. The patient app then can handle the push (if it is running directly, otherwise it will be displayed in the OS’ notification center and be handled when the app opens) and show something to the user.

1 Like

Thanks for your help, I found this post that shows how to do a portion of what you explained to me. I hope to get it! :slight_smile: