Huanxin Instant Messaging SDK Integration——[Super Complete Summary] Precautions for Integrating Huanxin Message Push (Huawei, oppo, vivo, etc.)

Huanxin Instant Messaging IM supports the integration of message push services from third-party manufacturers, providing Android developers with offline message push services with low latency, high delivery, high concurrency, and no infringement of user personal data.

When the client application process is closed and other reasons cause the user to go offline, Huanxin Instant Messaging IM service will push a message notification to the offline user's device through the message push service of the third-party manufacturer. When the user goes online again, all messages during the offline period will be received.

Currently supported mobile phone manufacturers push services include: Google, Huawei, Xiaomi, OPPO, VIVO and Meizu. This article introduces the matters needing attention when implementing the push service of each vendor in the client application.

1. Precautions for initialization

Examples provided in the reference documentation

This part of the operation is performed when the ring letter is initialized

Notice:

EMoptions must not create objects repeatedly. If you repeatedly create objects, there will be no error reporting for repeated objects, so it will cause the certificate to not be bound during initialization, so special attention should be paid to this

2. Matters needing attention in FCM push

(1) FCM push upload

The json file in this picture needs to be uploaded to the Huanxin management background, not the json for the client

(2) The parameter value of options.enableFCM("") is the SenderID uploaded in the ring letter management background


The id about client binding is project_number in our google-service.json file

(3) If there is no notification when receiving the push, you can check whether you have written the local notification in EMFCMMSGService. Huanxin only made a wake-up for FCM and you need to make a local notification for display. If you do not see the notification but the receiver has woken up, it is considered successful. If your judgment is not accurate, you can provide the log of the receiver to Huanxin technical support for viewing.

  ","marks":[{"type":"color","value":"#ffb45f"},{"type":"backgroundColor","value":"rgb(51, 51, 51)"},{"type":"fontFamily","value":"Courier New"},{"type":"fontSize","value":12}]}]}],"state":{}},{"type":"block","id":"LLhI-1665372447646","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"fiGI-1665372447644","leaves":[{"text":"","marks":[{"type":"fontSize","value":12}]}]}],"state":{}}]" style="white-space: normal;">

3. Precautions for Huawei Push

(1) The notification level of Huawei's notifications before the app is not released is unimportant notifications (operational notifications) by default. Only after it is online can you define your own boundaries. Secondly, it may be because of the limitation of the title of the push that is directly included in unimportant notifications.

(2) Huawei devices that support custom ringtones must be installed with Huawei Mobile Services 2.6+ or above, and the current app startup permission must be enabled

(3) Declare the appid in the manifest file <meta-data android:name="com.huawei.hms.client.appid" android:value="appid=fill in the appid of the developer" /> (4) Upload the certificate in the management background to upload the client secret in the OAuth2.0 client, starting with a lowercase key

(4) Upload the certificate in the management background to upload the Client Secret in the OAuth2.0 client

(5) Huawei manufacturer integration needs to import the agconnect-services.json file and the packaged class of the ring letter into the project (HMSPushHelper). After initialization, HMSPushHelper.getInstance().getHMSToken(this); needs to be referenced in the onCreate of Mainactivty;

HMSPushHelper is provided in the Huanxin demo, directly drag this class into your project and use it

(6) The notifications pushed by Huawei enter the marketing notifications, go to Huawei's official website and follow this to see the automatic rights and interests settings

4. OPPO push notifications

1. Screenshot of Huanxin management background

(1) When OPPO is integrated, the certificate is uploaded in the ring letter management background and the MasterSecret is uploaded, while the client (AS initialization) is bound to the AppSecret

2. Screenshot of Master location on oppo official website

oppo official link: [Push Service] OPPO PUSH Client SDK Interface Documentation (Version 2.1.0) - Mobile Services- Developer Community

(1) The client binding certificate is Appsecret call enableOppoPush("appkey","appSecret");

(2) SDK 3.7.1- upgrade 3.9.0 to 2.1.0 version initialization (HeytapPushManager.init(context,true)), if the OPPO aar version is 3.0.0, the ring letter sdk needs to be upgraded to be greater than or equal to 3.9.1, and the OPPO notification will also be classified as unimportant. The specific configuration needs to be configured in the OPPO console

(The sample picture shows that the SDK is 3.8.5, so oppo2.1.0.aar is used)

5. Precautions for VIVO integration

  (1) VIVO integration 3.9.1 or above needs to be upgraded to push version 3.0.0.4_484. Vivo defaults to push and operate messages. Re-uploading certificates needs to be reconfigured. The jar package needs to be placed under the libs curtain and synced

(2) Vivo needs to put the app on the shelf to receive offline push

For more detailed guides, please refer to the push document address: Android third-party push settings | Huanxin IM documents

Guess you like

Origin blog.csdn.net/huan132456765/article/details/130090636