This guide mainly introduces the process of integrating OPPO Push. The process falls into three steps:
Register OPPO Push
Integrate OPPO Push
Add Push - OPPO component in the IDE plugin. The steps are roughly the same as adding MPS SDK, see Add SDK.
The component only contains adaptive codes, without OPPO Push SDK. You can add the OPPO Push SDK dependencies separately by following the steps below.
Download OPPO Push SDK from OPPO PUSH Client SDK Interface Document and integrate the SDK to the main project.
The current adaptable version is V2.1.0. If you need to use a higher version, you can change it by yourself. Generally, the vendor’s SDK is downward compatible. If it is not compatible, you can submit a ticket about the adaption issue.
AndroidManifest.xml, and replace the value of
com.oppo.push.app_key. If you integrate the MiPush SDK through Portal & Bundle projects, please configure the
AndroidManifest.xmlin the Portal project.
<uses-permission android:name="com.coloros.mcs.permission.RECIEVE_MCS_MESSAGE" /> <uses-permission android:name="com.heytap.mcs.permission.RECIEVE_MCS_MESSAGE"/> <application> <service android:name="com.heytap.msp.push.service.CompatibleDataMessageCallbackService" android:permission="com.coloros.mcs.permission.SEND_MCS_MESSAGE" android:process=":push"> <intent-filter> <action android:name="com.coloros.mcs.action.RECEIVE_MCS_MESSAGE"/> </intent-filter> </service> <service android:name="com.heytap.msp.push.service.DataMessageCallbackService" android:permission="com.heytap.mcs.permission.SEND_PUSH_MESSAGE" android:process=":push"> <intent-filter> <action android:name="com.heytap.mcs.action.RECEIVE_MCS_MESSAGE"/> <action android:name="com.heytap.msp.push.RECEIVE_MCS_MESSAGE"/> </intent-filter> </service> <meta-data android:name="com.oppo.push.app_key" android:value="Obtained from the OPPO Developers platform" /> <meta-data android:name="com.oppo.push.app_secret" android:value="Obtained from the OPPO Developers platform" /> </application>
To use obfuscation, you need to add the related obfuscation configurations.
Test OPPO Push
After integrating OPPO Push, you can start the app on your OPPO phone, and the MPS SDK will automatically get the OPPO Push token and report it. Before you start the app, make sure that you have called the initialization method, see Message push initialization.
Push test messages when the app process is killed:
If you can still receive the messages, it means that the app has successfully integrated OPPO Push.
If you cannot receive the messages, you can follow the steps below for troubleshooting.
AndroidManifest.xmlhas related configurations added, and check if the values of
com.oppo.push.app_secretare the same as that on OPPO Developers Platform.
Check if OPPO Push is enabled in the mPaaS console (see Configure OPPO Push), and the relevant configurations are consistent with that on OPPO Developers Platform.
View the logs in Logcat to troubleshoot:
mPush.PushProxyFactory, and check if the following log exists:
D/mPush.PushProxyFactory: found proxy com.mpaas.push.external.oppo.Creator
If not, it means that there may be a problem with the Push - OPPO component. Check if the component has been correctly added.
mOPPO, and check if the channel token of OPPO Push has been obtained. If the following log (neither OPPO onRegister error nor responseCode is 0) appears:
It means the OPPO Push registration failed. See OPPO Push Error Codes for the failure reason.
Select the main process, filter
report channel token, check if the channel token of OPPO Push has been successfully reported. If the following log appears:
report channel token error: xxxx
It means the channel token reporting failed, you need to check if the
base64Codein the mPaaS configuration file has a value, and check if the apk signature that you uploaded when obtaining the configuration file is consistent with the app.
mcssdk, and view the internal logs of OPPO Push.
If the above steps do not resolve the issue, please search for the group number 31591197 with DingTalk to join DingTalk group for further communication.
Mobile models and OS versions supported by OPPO Push
Currently, OPPO phone models running ColorOS 3.1 and newer systems, OnePlus 5/5T and newer phone models, and all realme phone models are supported by OPPO Push.
ColorOS is a Android-based highly-customized, efficient, intelligent, and richly-designed mobile operating system developed by OPPO.