This topic describes how to integrate OPPO Push. The process has three main steps.
Register for OPPO Push
Create an account on the OPPO Open Platform and apply for the push service. For more information, see OPPO Push Platform User Guide.
Integrate OPPO Push
Install the Push - OPPO component. The installation process is the same as adding the push SDK. For more information, see Add the SDK. The Push - OPPO component contains only adaptation code and does not include the OPPO Push SDK.
Download the SDK from the OPPO SDK documentation and integrate it into your main project. The currently supported version is
3.4.0. To use a later version, you can modify it as needed. Vendor SDKs are typically backward compatible. If you find compatibility issues, join DingTalk group 145930007362 to request support for the new version.Configure
AndroidManifest.xml. If you use component-based integration, add the configuration in the Portal project. Replace the values ofcom.oppo.push.app_keyandcom.oppo.push.app_secret.<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:exported="true" 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:exported="true" 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="Get from the OPPO Open Platform" /> <meta-data android:name="com.oppo.push.app_secret" android:value="Get from the OPPO Open Platform" /> </application>If you use obfuscation, add the following obfuscation rules:
Add the OPPO Push obfuscation rules for all connection types.
If you use the AAR connection type, also add the mPaaS obfuscation rules.
If you use OPPO Push version
3.4.0, add the following dependency:implementation 'commons-codec:commons-codec:1.15'
Test OPPO Push
After you integrate OPPO Push, start your application on an OPPO phone and ensure the initialization method is called. For more information, see Message Push Service Initialization. The push SDK automatically obtains and reports the vendor token for OPPO Push.
Push a test message after you stop the application process:
If you receive the message, the integration is successful.
If you do not receive the message, follow the steps below to troubleshoot the issue.
Troubleshoot problems
Confirm that you have added the
AndroidManifest.xmlconfiguration. Check that the values forcom.oppo.push.app_keyandcom.oppo.push.app_secretmatch the values on the OPPO Open Platform.In the mPaaS console, confirm that the OPPO channel is enabled. For more information, see Configure the OPPO push channel. Check that the configurations match those on the OPPO Open Platform.
Check the logcat logs to troubleshoot the issue:
Select the push process, filter by
mPush.PushProxyFactory, and check for the following log entry:D/mPush.PushProxyFactory: found proxy com.mpaas.push.external.oppo.CreatorIf this log entry does not exist, there may be an issue with the Push - OPPO component. Confirm that you have added it correctly.
Select the push process and filter by
mOPPO. Check whether the vendor token for OPPO Push was obtained. If a log entry contains "OPPO onRegister error" or a `responseCode` other than 0, the OPPO Push registration failed. For more information about error codes, see the error code definitions section in the OPPO Push Error Codes document.Select the main process and filter by
report channel token. Check whether the OPPO vendor token was reported successfully. If you see the following log entry:report channel token error: xxxxThis indicates that the token report failed. Check that the
base64Codein the mPaaS configuration file has a value. Also, check that the APK signature you uploaded to obtain the configuration file matches the signature of the current application.Select the push process, filter by
mcssdk, and view the internal logs for OPPO Push.
Other questions
What models and system versions does OPPO Push support?
OPPO Push supports OPPO models that run ColorOS 3.1 or later, OnePlus 5/5T or later models, and all realme models.
ColorOS is a mobile operating system from OPPO. It is a deeply customized and optimized version of the Android operating system.