All Products
Search
Document Center

Access OPPO Push

Last Updated: Aug 03, 2021

This guide mainly introduces the process of accessing OPPO Push. The process falls into three steps:

  1. Register OPPO Push
  2. Access OPPO Push
  3. Test OPPO Push

Register OPPO Push

Register an account on the OPPO Developers Platform and request to access the push service with reference to Opening OPPO PUSH Service Guideline.

Access OPPO Push

  1. 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.
  2. 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.
  3. Configure AndroidManifest.xml, and replace the value of com.oppo.push.app_key. If you access the MiPush SDK through Portal & Bundle projects, please configure the AndroidManifest.xml in the Portal project.

       
    1. <uses-permission android:name="com.coloros.mcs.permission.RECIEVE_MCS_MESSAGE" />
    2. <uses-permission android:name="com.heytap.mcs.permission.RECIEVE_MCS_MESSAGE"/>
    3. <application>
    4. <service
    5. android:name="com.heytap.msp.push.service.CompatibleDataMessageCallbackService"
    6. android:permission="com.coloros.mcs.permission.SEND_MCS_MESSAGE"
    7. android:process=":push">
    8. <intent-filter>
    9. <action android:name="com.coloros.mcs.action.RECEIVE_MCS_MESSAGE"/>
    10. </intent-filter>
    11. </service>
    12. <service
    13. android:name="com.heytap.msp.push.service.DataMessageCallbackService"
    14. android:permission="com.heytap.mcs.permission.SEND_PUSH_MESSAGE"
    15. android:process=":push">
    16. <intent-filter>
    17. <action android:name="com.heytap.mcs.action.RECEIVE_MCS_MESSAGE"/>
    18. <action android:name="com.heytap.msp.push.RECEIVE_MCS_MESSAGE"/>
    19. </intent-filter>
    20. </service>
    21. <meta-data
    22. android:name="com.oppo.push.app_key"
    23. android:value="Obtained from the OPPO Developers platform"
    24. />
    25. <meta-data
    26. android:name="com.oppo.push.app_secret"
    27. android:value="Obtained from the OPPO Developers platform"
    28. />
    29. </application>
  4. To use obfuscation, you need to add the related obfuscation configurations.

Test OPPO Push

  1. After accessing 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.
  2. Push test messages when the app process is killed:
    • If you can still receive the messages, it means that the app has successfully accessed OPPO Push.
    • If you cannot receive the messages, you can follow the steps below for troubleshooting.

Troubleshooting

  1. Check if AndroidManifest.xml has related configurations added, and check if the values of com.oppo.push.app_key and com.oppo.push.app_secret are the same as that on OPPO Developers Platform.
  2. 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.
  3. View the logs in Logcat to troubleshoot:

    1. Select the push process, filter mPush.PushProxyFactory, and check if the following log exists:
           
      1. 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.
    2. Select the push process, filter 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:
      check oppo token
      It means the OPPO Push registration failed. See OPPO Push Error Codes for the failure reason.
    3. 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:

           
      1. report channel token error: xxxx

      It means the channel token reporting failed, you need to check if the base64Code in 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.

    4. Select the push process, filter mcssdk, and view the internal logs of OPPO Push.

  4. If the above steps do not resolve the issue, you can submit a ticket or contact the mPaaS support staff.

Other questions

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.