tencent cloud


Configuring and Viewing a License

Last updated: 2023-06-16 10:13:10

    UGSV License


    Before you call the APIs of the media SDKs, follow the steps below to configure the license:
    iOS Add the code below in [AppDelegate application:didFinishLaunchingWithOptions:] :
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    NSString * const licenceURL = @"<The license URL obtained>";
    NSString * const licenceKey = @"<The key obtained>";
    // `TXUGCBase` is in the header file `TXUGCBase.h`.
    [TXUGCBase setLicenceURL:licenceURL key:licenceKey];
    NSLog(@"SDK Version = %@", [TXUGCBase getSDKVersionStr]);
    return YES;
    - (void)onLicenceLoaded:(int)result Reason:(NSString *)reason {
    NSLog(@"onLicenceLoaded: result:%d reason:%@", result, reason);
    Android We recommend adding the following in the application:
    public class MApplication extends Application {
    public void onCreate() {
    String licenceURL = ""; // The license URL obtained
    String licenceKey = ""; // The license key obtained
    TXUGCBase.getInstance().setLicence(this, licenceURL, licenceKey);
    TXUGCBase.setListener(new TXUGCBaseListener() {
    public void onLicenceLoaded(int result, String reason) {
    Log.i(TAG, "onLicenceLoaded: result:" + result + ", reason:" + reason);
    If a live stream publishing license, a UGSV license, and a video playback license have the same license URL, you only need to configure license information once. You can apply for free trial licenses in the TRTC console, the CSS console, or the VOD console, or you can buy an official license.

    Viewing license information

    After the license is successfully configured, you can call the API below to view the license information. Please note that it may take a while for the configuration to take effect. The exact time needed depends on your network conditions.
    NSLog(@"%@", [TXUGCBase getLicenceInfo]);
    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