N
N
Neic2015-05-18 19:42:26
Android
Neic, 2015-05-18 19:42:26

What are push notifications?

What are push notifications? Can you give examples? Preferably under Android
As far as I understand: this can be, for example, some kind of service in the background, which will send a request to the server to receive an asynchronous response and in the status bar (status bar), will display to the user or, for example, in the activity in the form of a dialog on the worker a table or on top of the activity of another application (as, for example, Viber does this).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_ _, 2015-05-18
@thomas_white

Push notifications are initiated by the server, without the need to do any periodic checks in the application.
The scheme is roughly as follows:

  • The application registers with GCM, receiving a unique id (this can happen, for example, when logging in), and then sends this id to its server, most often with login information, in order to bind the id received from GCM to the user on the server.
  • Application listens for incoming messages using .GcmBroadcastReceiver
  • When some event occurs on the server (for example, a message was sent to the user), the server pulls out the desired id, which the application passed in the first paragraph and uses it to send a notification through the GCM gateway
  • The gateway itself destroys where to send something
  • The application triggers the code that was subscribed to receive notifications

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question