All Products
Search
Document Center

ApsaraVideo Live:Integrate the Push SDK license

Last Updated:Mar 29, 2024

To start stream ingest by using the Push SDK, you must use a license for authorization. This topic describes how to obtain and integrate the Push SDK license.

Usage notes

  • You can use an all-in-one license to authorize all applications within the same Alibaba Cloud account to access SDKs of Alibaba Cloud media services. You can use all-in-one licenses in Push SDK.

  • When you apply for licenses for Push SDK and other SDKs of Alibaba Cloud media services such as Queen SDK at the same time, the license key and license file of Push SDK are the same as those of other SDKs. You need to configure LicenseKey and LicenseFile only once. The latest version of the license file is used.

    Note

    If you requested and obtained an all-in-one license for a video cloud SDK other than Push SDK, such as Queen SDK, you can submit a request that includes the information about the application with which you want to integrate Push SDK on the Create Application and Bind License page to renew the authorization scope of the license. If you do not perform the preceding operation, license verification fails.

    This changes only the authorization scope of the license. The license key and license file remain the same. In this case, you do not need to reconfigure the license. However, you must register Push SDK before you use the stream ingest feature.

Apply for a license

To request a Push SDK license, submit the required information on the Request Push SDK License page. After your request is received, Alibaba Cloud handles the request within two business days.

Note
  • The Push SDK license is free of charge. The validity period of the license is one year. You must request a new license after your license expires.

  • Make sure that the request information is complete and in the valid format. If you need to change the package name, signature, or bundle ID, submit a request again.

  • If you do not have an Alibaba Cloud account, create one first. For more information, see Create an Alibaba Cloud account.

  • Information about the package name and MD5 signature of an Android application:

    • The MD5 signature is a string of lowercase letters. Do not include colons (:) in the string.

    • You can obtain the package name and signature by using one of the following methods:

      Method 1: Use the signature tool to obtain the package name and signature. After you install the tool, follow the instructions of the tool.

      Method 2: Download the source code of the demo of Push SDK for Android V4.4.2 or later from SDK download and release notes. Then, call the getSingInfo method of the SignatureUtils utility class to generate a signature.

Configure the license

After you apply for a license, the license key and license file are sent to you by email. Perform the following steps to configure the Push SDK license.

Configure a license for Android

  1. Recommended. Copy the certificate file to the assets directory in the Android Studio project.

    Note

    You can also copy the certificate file to another location on the device, but make sure that the value corresponding to the com.aliyun.alivc_license.licensefile in Step 2 is consistent with the license path.

  2. Add a <meta-data> node to the AndroidManifest.xml file.

    Important

    If the verification fails after you configure the license, check whether a <meta-data> node is created under the <application> element and whether the name of the <meta-data> node is correct.

    image.png

    <meta-data
        android:name="com.aliyun.alivc_license.licensekey"
        android:value="foIVziMaUHaRqgDyhf6b6eb8fcf014af39535d0720a32****"/>  <! -- TODO: Specify the license key-->
    <meta-data
        android:name="com.aliyun.alivc_license.licensefile"
        android:value="assets/cert/release.crt"/>  <! -- TODO: Specify the license path--> 

Configure a license for iOS

  1. Copy the certificate file to the specified directory of the Xcode project and select the current project in Target Membership.

    image.png

  2. Open the Info.plist file and set the values of AlivcLicenseKey and AlivcLicenseFile to the license key and license path that you obtain when you register a license.

Register Push SDK

Before you can use the stream ingest feature, you must register Push SDK. You must configure the Push SDK license before you register Push SDK.

Register Push SDK for Android

Call the registerSDK operation before you use Push SDK

AlivcLiveBase.setListener(new AlivcLiveBaseListener() {
  @Override
  public void onLicenceCheck(AlivcLivePushConstants.AlivcLiveLicenseCheckResultCode result, String reason) {
    Log.e(TAG, "onLicenceCheck: " + result + ", " + reason);
  }
});
AlivcLiveBase.registerSDK();
  • You can call the AlivcLiveBase class to perform operations such as setting the log level and local log path and obtaining the SDK version.

  • You must call the registerSDK method in AlivcLiveBase to register an SDK license.

  • Listen for the onLicenceCheck callback in AlivcLiveBaseListener to asynchronously receive the license verification result. This allows you to determine whether the license key and license file that you provide pass the verification.

Note

The callback can be fired only after the AlivcLivePusher instance is initialized.

Register Push SDK for iOS

Call the registerSDK operation before you use Push SDK

[AlivcLiveBase registerSDK];
  • You can call the AlivcLiveBase class to perform operations such as setting the log level and local log path and obtaining the SDK version.

  • Listen for the onLicenceCheck callback in AlivcLiveBaseObserver to determine whether the license key and license file that you provide pass the verification.