The vivo channel is a system-level push channel officially provided by vivo. On a vivo phone, push messages can be delivered through vivo's system channel without opening the application. For more information, please visit vivo push official website.
Note:
- If an application cannot be opened after you click the notification on the debugging version, please find the pop-up window permission and enable it for the current application.
- The vivo channel currently does not support in-app messages, which will be delivered through the TPNS channel.
- The vivo channel imposes a certain quota limit on the number of daily push messages. For more information, please see Vendor Channel Limit Description. When this limit is exceeded, excessive messages will be pushed through the TPNS channel.
- Operation messages can be pushed through the vivo channel between 7:00 and 23:00, while only system messages can be pushed in other periods. For more information on how to apply for system messages, please see Applying for vivo system messages.
- For the vivo channel, the maximum number of operation messages one user can receive from one application per day is 5, while the number of system messages is unlimited.
- The vivo channel is supported only on certain newer models and corresponding OS versions. For more information, please see here.
AppID
, AppKey
, and AppSecret
. For more information, please see Quick Integration Guide.
Note:Only applications that have been approved by and launched to the vivo open platform can be approved by the TPNS service.
AppId
, AppKey
, and AppSecret
parameters of the application into TPNS console -> Configuration Management -> Basic Config -> vivo Official Push Channel.Complete the configuration required by TPNS in the build.gradle
file in the Application module and then add the following nodes:
Configure vivo's AppID
and AppKey
. The sample code is as follows:
manifestPlaceholders = [
VIVO_APPID:"xxxx",
VIVO_APPKEY:"xxxxx",
]
Import the dependencies related to vivo. The sample code is as follows:
implementation 'com.tencent.tpns:vivo:[VERSION]-release' // For vivo pushes, [VERSION] is the SDK's version number, which can be obtained from the release notes of SDK for Android.
Note:For vivo pushes, [VERSION] is the SDK’s version number, which can be obtained from the release notes of SDK for Android.
After getting the TPNS SDK package for vivo Push, configure the major TPNS version and the following content in the manual integration method detailed on TPNS's official website.
Other-Push-jar
folder and import the vivo Push-related jar package.Androidmanifest.xml
file: <application>
<service
android:name="com.vivo.push.sdk.service.CommandClientService"
android:exported="true" />
<activity
android:name="com.vivo.push.sdk.LinkProxyClientActivity"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<!-- Receiver declaration for pushing app's custom messages -->
<receiver android:name="com.tencent.android.vivopush.VivoPushMessageReceiver" >
<intent-filter>
<!-- Receive push message -->
<action android:name="com.vivo.pushclient.action.RECEIVE" />
</intent-filter>
</receiver>
<meta-data
android:name="com.vivo.push.api_key"
android:value="vivo appkey" />
<meta-data
android:name="com.vivo.push.app_id"
android:value="vivo appid" />
</application>
Enable the third-party push API before calling TPNS' XGPushManager.registerPush
:
// Enable third-party push
XGPushConfig.enableOtherPush(getApplicationContext(), true);
// The log of successful registration is as follows:
I/TPush: [OtherPushClient] handleUpdateToken other push token is : 160612459******08955218 other push type: vivo
I/TPush: [PushServiceBroadcastHandler] >> bind OtherPushToken success ack with [accId = 150000**** , rsp = 0] token = 01a22fb503a33******66b89fad6be3ed343 otherPushType = vivo otherPushToken = 160612459******08955218
-dontwarn com.vivo.push.**
-keep class com.vivo.push.**{*; }
-keep class com.vivo.vms.**{*; }
-keep class com.tencent.android.vivopush.VivoPushMessageReceiver{*;}
Note:Obfuscation rules must be stored in the
proguard-rules.pro
file at the application project level.
If you observe logs similar to the following, it indicates that registration with the vivo channel fails. In that case, you can use the method described as below to get the vivo Push registration error code.
[OtherPushClient] handleUpdateToken other push token is : other push type: vivo
In debugging mode of the push service, filter logs by the keyword OtherPush
to view the return code logs, for example, [OtherPushVivoImpl] vivoPush Register or UnRegister fail, code = 10003
. Then locate the error cause and rectify the error by referring to Troubleshooting Vendor Channel Registration Failures.
Official messages cannot be sent during application approval. Please go to the vivo push platform to check the push permission approval progress.
Was this page helpful?