Joke Collection Website - Blessing messages - How does java push messages to the front end

How does java push messages to the front end

The main methods for Java server to push messages to the front end:

Java has two interfaces:

1, "/subscribe" interface: used for message subscription. This interface has a parameter topic, that is, the subscribed message topic.

2. "/publish" interface: publishing message interface, with two parameters, topic is publishing message theme and content is publishing message content.

Users can also consider using Aurora Push. JPush provides four message forms: notification, customized message, rich media and local notification.

1, notification, or push notification, refers to the notification message displayed on the notification bar (status bar) of the mobile phone. Notification is mainly used to remind users, which is applied to news content, promotion activities, product information, version update reminder, order status reminder and other scenarios.

2. Custom message: The custom message is not a notification, so the SDK will not be displayed on the notification bar. Its content is completely defined by the developers themselves. Custom messages are mainly used for the internal business logic of the application. Push a custom message, and there may be no interface display.

3. Rich media: JPush supports developers to send illustrated notices, thus better conveying information and bringing richer user interaction. JPush provides five templates, and developers can send rich media notifications in the form of landing pages, pop-ups and information streams by filling in the contents of the templates. Developers can also send pre-edited pages directly through URL.

4. Local notification: The local notification API does not depend on the network, and it can still be triggered without the network; The timing time of local notification is calculated from the time of sending, and is not affected by operations such as intermediate shutdown. Local notifications and network push notifications are independent of each other and are not limited by the maximum number of recent notifications.

Aurora Push can also push messages to specific users by using tags, aliases, registration ID and user groups.