Vivo channel integration

Last updated: 2020-05-13 18:36:05


Operation Scenarios

The Vivo push 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's official website.

  • If an application cannot be opened after you tap the notification on the debugging version, please find the pop-up window permission and enable it for the current application.
  • Vivo Push currently does not support in-app messages, which will be displayed as notifications.
  • Vivo Push imposes a certain limit (which is not disclosed) on the number of daily push messages. When this limit is exceeded, excessive messages will be pushed through the TPNS channel.


Getting key

You need to apply to Vivo for enabling the push permission so as to get three keys, namely, AppID, AppKey, and AppSecret. For more information, please see Quick Integration Guide.


Integrating through Android Studio

Complete the configuration required by TPNS 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 = [
  2. Import the dependencies related to Vivo. The sample code is as follows:
    implementation 'com.tencent.tpns:vivo:[VERSION]-release' // Vivo Push [VERSION] is the version number of the current SDK, which can be viewed on the SDK download page

Integrating through Eclipse

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.

  1. Import the jar packages related to Vivo Push. Import vivo4tpns1.1.2.1.jar to the project folder:
  2. Add the following configuration to the Androidmanifest.xml file:
            android:exported="true" />

            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <!-- Receiver declaration for pushing application's custom messages -->
        <receiver android:name="" >

                <!-- Receive push message -->
                <action android:name="" />

            android:value="Vivo appkey" />
            android:value="Vivo appid" />


Enabling Vivo push

Enable the third-party push API before calling TPNS' XGPushManager.registerPush:

// Enable the third-party push
XGPushConfig.enableOtherPush(getApplicationContext(), true);

// The log of successful registration is as follows:
 I/XINGE: [XGOtherPush] other push token is : 15646472431991408944055  other push type: vivo
I/XINGE: [PushServiceBroadcastHandler]  bind OtherPushToken success ack with [accId = 1500xxxxxx  , rsp = 0]  token = 0139f9840030882cfe7cc791aebc800ed270 otherPushType = vivo otherPushToken = 15646472431991408944055

Code obfuscation

-keep class**{*; }
-keep class**{*; }
-keep class{*;}

Obfuscation rules must be stored in the file at the application project level.