All Products
Search
Document Center

Mobile Platform as a Service:OPPO Push

Last Updated:Jul 26, 2024

This article describes the access process of OPPO push, including the following three steps.

  1. Register OPPO Push

  2. Add OPPO Push

  3. Test OPPO push

Register OPPO Push

Register an account on the OPPO Open Platform and apply for access to the push service. For more information, see OPPO Push Platform User Guide.

Connect to OPPO Push

  1. Install the push- OPPO component in the same way as you add the push SDK. For more information, see Add an SDK. The Push- OPPO component contains only adaptation code and does not contain OPPO Push SDK.

  2. Go to the OPPO SDK documentation to download the SDK and integrate it into the main project. The current version of the adaptation is 3.4.0. If you need to use a higher version, you can modify it according to your requirements. Generally speaking, the vendor SDK will be backward compatible. If it is not compatible, you can join the DingTalk group 41708565 to feed back and adapt to the requirements of the new version.

  3. Configure the AndroidManifest.xml (add the component-based method in the Portal project) and replace the com.oppo.push.app_key and com.oppo.push.app_secret values in it.

         <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="OPPO open platform acquisition"
                 />
             <meta-data
                 android:name="com.oppo.push.app_secret"
                 android:value="OPPO Open Platform Acquisition"
                 />
         </application>
  4. To use obfuscation, add the relevant obfuscation configuration:

  5. If you are using the OPPO push version 3.4.0, you must add the following dependencies:

    implementation 'commons-codec:commons-codec:1.15'

Test OPPO push

  1. After OPPO push is enabled, you can start your application on your mobile phone and make sure that the initialization method is called. For more information, see Initialize message push. The push SDK automatically obtains the vendor token of OPPO push and reports the token.

  2. You can push a test message when the application process is killed:

    • If you still receive the message, the application is successfully connected to OPPO Push.

    • If you cannot receive the message, troubleshoot the issue as follows.

Troubleshooting

  1. Check whether the AndroidManifest.xml configuration is added and whether the values of com.oppo.push.app_key and com.oppo.push.app_secret are consistent with those of the OPPO open platform.

  2. Check whether the OPPO channel is enabled in the mPaaS console. For more information, see Configure the OPPO push channel.

  3. View the logcat logs for troubleshooting:

    1. Select the push process, filter the mPush.PushProxyFactory, and check whether the following logs exist:

      D/mPush.PushProxyFactory: found proxy com.mpaas.push.external.oppo.Creator

      If no push- OPPO component is available, a problem may exist when you add the push- OPPO component. Check whether the push- OPPO component is added.

    2. Select the push process, filter mOPPO, and check whether the vendor token pushed by OPPO is obtained. If the following log is displayed ("OPPO onRegister error" or "responseCode" is not 0), it indicates that the OPPO push registration failed. For error codes, see OPPO push error codes, and drop down to the error code definition description section.

    3. Select the main process, filter the report channel token, and check whether the OPPO vendor token is successfully reported. If the following log appears:

      report channel token error: xxxx

      This indicates that the vendor token fails to be reported. Please check whether the base64Code of the mPaaS configuration file has a value and whether the apk signature uploaded when obtaining the configuration file is consistent with the current application.

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

Other FAQ

What models and system versions does OPPO push support?

Currently, OPPO models, OnePlus 5/5T and above and realme models are supported for ColorOS 3.1 and above systems.

ColorOS is a mobile phone operating system that is deeply customized and optimized based on Android system launched by OPPO.