OPPO Push

更新时间:
复制 MD 格式

Integrate OPPO Push into your Android app in three steps: register for the push service, add the SDK and configuration, then verify delivery.

  1. Register for OPPO Push

  2. Integrate OPPO Push

  3. Test OPPO Push

Register for OPPO Push

Create an account on the OPPO Open Platform and apply for the push service. For setup instructions, see the OPPO Push Platform User Guide.

Integrate OPPO Push

  1. Install the Push - OPPO component using the same process as adding the push SDK. For details, see Add the SDK. The Push - OPPO component contains only adaptation code and does not include the OPPO Push SDK.

  2. Download the OPPO Push SDK from the OPPO SDK documentation and integrate it into your main project. The currently supported version is 3.4.0. You can upgrade to a later version if needed — vendor SDKs are typically backward compatible. For help with an unsupported version, join DingTalk group 145930007362 to request it.

  3. Configure AndroidManifest.xml. For component-based integration, add this configuration in the Portal project. Replace the placeholder values for com.oppo.push.app_key and com.oppo.push.app_secret with the credentials from the OPPO Open Platform.

         <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>
  4. If you use obfuscation, add the following rules:

  5. If you use OPPO Push version 3.4.0, add this dependency:

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

Test OPPO Push

  1. Launch your app on an OPPO device and confirm the initialization method is called. For details, see Message Push Service Initialization. The push SDK automatically obtains and reports the vendor token for OPPO Push.

  2. Stop the app process, then send a test push notification:

    • If the notification arrives, the integration is complete.

    • If the notification does not arrive, follow the troubleshooting steps below.

Troubleshooting

  1. Confirm that you have configured AndroidManifest.xml. Verify that the values for com.oppo.push.app_key and com.oppo.push.app_secret match what is shown on the OPPO Open Platform.

  2. In the mPaaS console, confirm that the OPPO channel is enabled. For details, see Channel Configuration. Verify that these settings match those on the OPPO Open Platform.

  3. Check the logcat logs for each of the following:

    1. In the push process, filter by mPush.PushProxyFactory and look for:

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

      If this log entry is missing, the Push - OPPO component may not be installed correctly.

    2. In the push process, filter by mOPPO to check whether the OPPO vendor token was obtained. A log entry containing "OPPO onRegister error" or a responseCode other than 0 means registration failed. Look up the error code in the OPPO Push Error Codes document to identify the cause.

    3. In the main process, filter by report channel token to check whether the vendor token was reported successfully. The following log entry indicates a reporting failure:

      report channel token error: xxxx

      If you see this error, confirm that base64Code in the mPaaS configuration file has a value. Also confirm that the APK signature you uploaded to generate the configuration file matches the signature of the current build.

    4. In the push process, filter by mcssdk to review the internal OPPO Push logs.

  4. If the issue persists, submit a ticket or contact the mPaaS helpdesk.

FAQ

What models and system versions does OPPO Push support?

OPPO Push supports OPPO devices running ColorOS 3.1 or later, OnePlus 5/5T and later models, and all realme devices.

ColorOS is OPPO's mobile operating system, a customized build of Android.