This topic describes how to connect to vivo Push. The process consists of three steps.
Register for vivo Push
For more information, see the vivo Push Platform User Guide. On the vivo Open Platform, create an account and request access to the push service.
Connect to vivo Push
Add the Push - vivo component. This process is the same as adding the push SDK. For more information, see Add an SDK. The Push - vivo component contains only adaptation code and does not include the vivo Push SDK.
Go to the vivo SDK documentation to download the SDK and integrate it into your main project. The currently supported version is v2.3.4. If you want to use a later version, you may need to make modifications. Vendor SDKs are usually backward compatible. If you encounter compatibility issues, join DingTalk group 145930007362 to request support for the new version.
Configure the
AndroidManifest.xmlfile. If you are using a component-based approach, add the configuration in the Portal project. Then, replace the values forcom.vivo.push.api_keyandcom.vivo.push.app_id.<application> <service android:name="com.vivo.push.sdk.service.CommandClientService" android:process=":push" android:exported="true" /> <activity android:name="com.vivo.push.sdk.LinkProxyClientActivity" android:exported="false" android:process=":push" android:screenOrientation="portrait" android:theme="@android:style/Theme.Translucent.NoTitleBar" /> <meta-data android:name="com.vivo.push.api_key" android:value="Provided by vivo Open Platform" /> <meta-data android:name="com.vivo.push.app_id" android:value="Provided by vivo Open Platform" /> </application>To use obfuscation, add the relevant obfuscation configurations:
All connection types require you to add the vivo Push obfuscation rules.
If you use the AAR connection type, you must also add mPaaS obfuscation rules.
Test vivo Push
After connecting to vivo Push, start your application on a vivo phone. Ensure that the initialization method is called. For more information, see Message Push Service Initialization. The push SDK automatically retrieves and reports the vivo Push vendor token.
Push a test message after you terminate the application process:
If you receive the message, the application is successfully connected to vivo Push.
If you do not receive the message, follow the steps below to troubleshoot.
Troubleshooting
Verify that the
AndroidManifest.xmlconfiguration has been added. Ensure that the values forcom.vivo.push.api_keyandcom.vivo.push.app_idmatch the values on the vivo Open Platform.In the mPaaS console, verify that the vivo channel is enabled. For more information, see Configure the vivo push channel. Ensure that the configurations match those on the vivo Open Platform.
To troubleshoot, check the logcat logs:
Select the push process, filter for
mPush.PushProxyFactory, and check for the following log entry:D/mPush.PushProxyFactory: found proxy com.mpaas.push.external.vivo.CreatorIf this log entry does not exist, there may be an issue with how the Push - vivo component was added. Verify that it was added correctly.
Select the push process and filter for
mVIVO. Check whether the vivo Push vendor token was obtained. If the log entry"fail to turn on vivo push"appears, the vivo Push registration failed. For more information about the error code (state), see vivo Push error codes.Select the main process and filter for
report channel token. Check whether the vivo vendor token was reported successfully. If the following log entry appears:report channel token error: xxxxThis log indicates that the vendor token was not reported. Check whether
base64Codein the mPaaS configuration file has a value. Also, verify that the APK signature uploaded when you obtained the configuration file matches the signature of the current application.
FAQ
What models and system versions does vivo Push support?
The table below lists the models and minimum system versions supported by the SDK. For other questions about vivo Push, see vivo Push FAQ.
