tencent cloud

Feedback

vivo Channel Integration

Last updated: 2024-01-16 17:39:39

    Overview

    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, visit vivo push official website.
    Note:
    If an application cannot be opened after you click the notification on the debugging version, 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 Tencent Push Notification Service channel.
    The vivo channel imposes a certain quota limit on the number of daily push messages. For more information, see Vendor Channel Limit Description. When this limit is exceeded, excessive messages will be pushed through the Tencent Push Notification Service 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, 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, see here.

    Directions

    Obtaining a key

    1. You need to apply to vivo for enabling the push permission so as to get three key parameters, namely, AppID, AppKey, and AppSecret. For more information, see Quick Integration Guide.
    Note:
    Only applications that have been approved by and launched to the vivo open platform can be approved by the Tencent Push Notification Service.
    2. Copy the application's AppID, AppKey, and AppSecret and paste them into Tencent Push Notification Service console > Configuration Management > Basic Configuration > vivo Official Push Channel.

    Configuration

    Integrating through Android Studio

    Complete the configuration required by Tencent Push Notification Service in the build.gradle file in the Application module and then add the following nodes:
    1. Configure vivo's AppID and AppKey. The sample code is as follows:
    manifestPlaceholders = [
    VIVO_APPID:"xxxx",
    VIVO_APPKEY:"xxxxx",
    ]
    2. 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.

    Integrating through Eclipse

    After getting the Tencent Push Notification Service SDK package for vivo Push, configure the major Tencent Push Notification Service version and the following content in the manual integration method detailed on Tencent Push Notification Service's official website.
    1. Download the SDK installation package.
    2. Open the Other-Push-jar folder and import the vivo Push-related jar package.
    3. Add the following configuration to the Androidmanifest.xml file:
    <application>
    <service
    android:name="com.vivo.push.sdk.service.CommandClientService"
    android:exported="true"
    android:permission="com.push.permission.UPSTAGESERVICE" />
    <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"
    android:exported="false">
    <intent-filter>
    <!-- Receive push message -->
    <action android:name="com.vivo.pushclient.action.RECEIVE" />
    </intent-filter>
    </receiver>
    <!-- version 3.0.0.3 -->
    <!-- If this field is greater than or equal to 480, you can click the message to directly open the application activity. This solves the slow startup problem. -->
    <meta-data
    android:name="sdk_version_vivo"
    android:value="483" />
    <meta-data
    android:name="local_iv"
    android:value="MzMsMzQsMzUsMzYsMzcsMzgsMzksNDAsNDEsMzIsMzgsMzcsMzYsMzUsMzQsMzMsI0AzNCwzMiwzMywzNywzMywzNCwzMiwzMywzMywzMywzNCw0MSwzNSwzNSwzMiwzMiwjQDMzLDM0LDM1LDM2LDM3LDM4LDM5LDQwLDQxLDMyLDM4LDM3LDMzLDM1LDM0LDMzLCNAMzQsMzIsMzMsMzcsMzMsMzQsMzIsMzMsMzMsMzMsMzQsNDEsMzUsMzIsMzIsMzI" />
    <!-- version 3.0.0.3 end-->
    <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>
    

    Enabling vivo Push

    Enable the third-party push API before calling Tencent Push Notification Service's 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
    

    Code obfuscation

    -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.

    Troubleshooting

    Querying vivo Push registration error codes

    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 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.

    Why do I receive the error code 10045 when I push messages with vivo Push?

    Official messages cannot be sent during application approval. Please go to the vivo push platform to check the push permission approval progress.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support