Oppo and Xiaomi phones can not receive messages
Application information pushed by OPPO can be obtained only after the application is online.
Huawei mobile phone offline push vendor channel failed
When huawei platform creates PUSH rights, the SHA256 fingerprint certificate needs to be filled in.
In addition, Huawei’s push test must be packaged with its own certificate. (Huawei provides SHA256 fingerprint certificate verification)
Huawei platform SHA256 Fingerprint certificate Fill in the following figure:
“Certificate environment error” is displayed when an iOS certificate is uploaded
Guide certificate do not guide the key string in, remember is push certificate, not package certificate, two do not mix up.
Monitoring issues about push
Push messages are classified into two types: notification messages and transparent messages
(1) The notification message push will be displayed in the message center. Click the notification to start (activate) the application to the foreground and trigger the “click” event.
(2) Transparent data push, can respond to click and receive.
-
The format for sending transparent data is standard ({title:” notification title “,content:” notification content “,payload:” notification test “}), and it is displayed in the message center. When the user clicks the message, it will respond to the click event.
-
Pass-through data sent is not in standard format and the application is currently active, and these conditions are met to respond to receive events and not be displayed in the message center.
Summarized as:
-
Trigger the Click event: Send passthrough data in a standard format that is displayed in the message center.
-
Trigger receive: Transparent data is sent in a non-standard format and is applied in an active state. It is not displayed in the message status bar.
ios:
-
Online: Responds only to receive and does not display push notifications in the system message center.
-
Offline: Send a push notification through the Apple APNS channel. After receiving the notification, the mobile phone will display the notification in the system notification bar. Click the message to start the application (if it has been started, it will switch from the background to the foreground), and trigger the “click” event.
Android:
-
Online (multiple push channels are available) : Push notifications and transparent messages use each push channel to deliver a push message.
-
Offline (all push channels are unavailable) : If a vendor’s mobile phone matches vendor push (the vendor’s mobile phone is configured with vendor push parameters and is on the corresponding vendor’s mobile phone), the vendor push channel is used to deliver push messages. Otherwise, the offline message will be stored in the offline message library when the APP is online during offline time.
In the onLaunch method of app. vue file, the specific code is shown as follows:
plus.push.setAutoNotification(true)
// [APP online], the notification column will not be reminded after receiving the pass through message, and the local message needs to be sent, and then the click event triggered by clicking will be triggered.
// [APP offline], the click event can only be triggered if the message is received through offline transmission, and the payload must be carried by the Intent string in the Java background
plus.push.addEventListener("click".function(msg) {
var payload; console.log("addEventListener click:" + JSON.stringify(msg)); if (isIOS) { //APP offline click contains the click attribute, payload is a JSON object if (msg.type && msg.type == "click") { payload = msg.payload; } else { // The APP is online. The received message does not contain the type attribute. In this case, the payload is a JSON string and needs to be converted into a JSON object payload = JSON.parse(msg.payload); } navigateTo(payload) } else { payload = JSON.parse(msg.payload); if (typeof payload === "string") { payload = JSON.parse(payload) } navigateTo(payload) } }, false); plus.push.addEventListener('receive'.function(msg) { console.log("addEventListener receive:" + JSON.stringify(msg)); if (isIOS) { // [APP offline] Received a message, but no reminder (occurs when multiple offline messages are received at a time, only one message is reminded, but the others are not reminded) [APP online] System messages will not be triggered when the message is received. Local messages need to be created, but cannot be created repeatedly. Msg. type validation must be added to remove the dead loop if(! msg.aps && msg.type =="receive") { // Create a local message. The local message sent is also received by the receive method, but there is no type attribute and aps is null plus.push.createMessage(msg.content, JSON.stringify(msg.payload), { title: msg.title }); } } else { // For Android, when the APP is online, a transparent message will not enter the system, and you need to send a local reminder. plus.push.createMessage(msg.content, JSON.stringify(msg.payload), { title: msg.title }); } }); Copy the code
Continue to update all kinds of unipush questions, welcome to ask!
This article is formatted using MDNICE