1. Don’t count on GMS: google messange server, I am a big country 2. The commonly used method now is: open a PushService when the application starts, and go to the server to make a long connection (mqtt, xmpp protocol etc.), and then the server pushes the message to PushService through a long connection. PushService generates a notification after receiving the message. You can build a push server yourself, but it is recommended to use a third-party SDK, such as Homing Pigeon, Aurora Push, and Baidu Push, which can meet most needs. A problem may arise if you use method 2. It does not guarantee that PushService will always survive, so you need to solve how to ensure that PushService is not killed.
The 2 mentioned by @Akioss is indeed a commonly used method. For PushService, the alarmmanger can do a scheduled task and send heartbeats to the server regularly. It can also ensure that the pushservice is alive. If it is not there, it can be up.
I made an app before, using androidpn, but this thing needs to be modified by myself before it can be used. For it, I just used a third party. There are many choices, you can check online
Currently, most solutions for applications on the market are to use third-party push services.
Our solution is for developers to integrate our Android SDK on the client, and the server can send messages to the Android client through the SDK or using RESTful API.
In terms of real-time performance, the Android SDK will start a background Service to create and maintain a long connection to the Yunba server, thus ensuring the real-time performance of message push.
Moreover, when the client is currently offline, we can support the offline message function to ensure that messages are delivered to the client.
In addition, for Android 5.0 and above platforms, the application will be killed when entering the background, resulting in the problem that users cannot receive App message push. We have also upgraded the existing solution and integrated Huawei and Xiaomi For the manufacturer channel, you can use Yunba push to push models from several manufacturers with one click to ensure the arrival rate.
1. Don’t count on GMS: google messange server, I am a big country
2. The commonly used method now is: open a PushService when the application starts, and go to the server to make a long connection (mqtt, xmpp protocol etc.), and then the server pushes the message to PushService through a long connection. PushService generates a notification after receiving the message. You can build a push server yourself, but it is recommended to use a third-party SDK, such as Homing Pigeon, Aurora Push, and Baidu Push, which can meet most needs.
A problem may arise if you use method 2. It does not guarantee that PushService will always survive, so you need to solve how to ensure that PushService is not killed.
The 2 mentioned by @Akioss is indeed a commonly used method. For PushService, the alarmmanger can do a scheduled task and send heartbeats to the server regularly. It can also ensure that the pushservice is alive. If it is not there, it can be up.
You can try Tencent Pigeon, I used it last year, I don’t know how it is now
I made an app before, using androidpn, but this thing needs to be modified by myself before it can be used. For it, I just used a third party. There are many choices, you can check online
To achieve real-time, you need server push. You can use Aurora Push, which has the best effect
Currently, most solutions for applications on the market are to use third-party push services.
Our solution is for developers to integrate our Android SDK on the client, and the server can send messages to the Android client through the SDK or using RESTful API.
In terms of real-time performance, the Android SDK will start a background Service to create and maintain a long connection to the Yunba server, thus ensuring the real-time performance of message push.
Moreover, when the client is currently offline, we can support the offline message function to ensure that messages are delivered to the client.
In addition, for Android 5.0 and above platforms, the application will be killed when entering the background, resulting in the problem that users cannot receive App message push. We have also upgraded the existing solution and integrated Huawei and Xiaomi For the manufacturer channel, you can use Yunba push to push models from several manufacturers with one click to ensure the arrival rate.