nanocosmos Documentation

nanocosmos Documentation

  • nanoStream Cloud
  • H5Live Player
  • nanoStream Webcaster
  • nanoMeet
  • nanoStream Apps and SDKs
  • Samples
  • FAQ

›iOS

nanoStream SDKs/Apps

  • Introduction

Android

  • Getting started
  • Playback
  • Streaming Media
  • Sample

iOS

  • Developer Quickstart
  • Getting started
  • SDK for iOS
  • bintu.live client SDK
  • iOS Streaming App in 5 Minutes
  • License Deployment Information

Windows

  • Binary Modules for Windows
  • Developer Manual
  • nanoStream Windows Language Integration
  • Setting the license
  • RTMP Network Renderer & Writer
  • Encoder Plugin API

DirectShow

  • Overview
  • H264
  • RTMP
  • RTMP Writer
  • RTSP
  • UDP/TS Streaming
  • Video Filter
Edit

License Deployment Information

For temporary license keys, you need to ensure your app will be updated early enough before expiration. To avoid in-app expiration, you may load the license key from your server over a secure https connection. You need to ensure the server connection is protected against 3rd party access

Sample code for iOS


NSString * const kNSXLicenseKey = @"kNSXLicenseKey";

@implementation NSXLicenseHelper

-(void)downloadLicenseFromURL:(NSURL *)url handler:(void ()(NSString *license))completion
{
  if (!completion) {
    return;
  }
  if (!url) {
    completion(nil);
  }

  NSURLSessionConfiguration* sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration];

  /* Create session, and optionally set a NSURLSessionDelegate. */
  NSURLSession session = [NSURLSession sessionWithConfiguration:sessionConfig delegate:nil delegateQueue:nil];

  NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:url];
  request.HTTPMethod = @"GET";

  /* Start a new Task */
  NSURLSessionDataTask task = [session dataTaskWithRequest:request completionHandler:NSData *data, NSURLResponse *response, NSError *error {
    if (error == nil) {
      NSString *license = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
      if ([license hasPrefix:@"nlic:"]) {
        [self saveLicense:license];
        return completion(license);
      }
    }
    return completion(nil);
  }];

  [task resume];
}

-(void)saveLicense:(NSString *)license
{
  [[NSUserDefaults standardUserDefaults] setObject:license forKey:kNSXLicenseKey];
}

-(NSString *)getSavedLicense
{
  return [[NSUserDefaults standardUserDefaults] stringForKey:kNSXLicenseKey];
}

Last updated on 9/11/2023
← iOS Streaming App in 5 MinutesBinary Modules for Windows →
  • Sample code for iOS
Contact
HomepageContactSupportLegal Terms
Products
Nanostream Cloud with Bintu.LiveH5Live Low Latency HTML5-PlayernanoStream WebcasterNanostream Apps and SDK
More
BlogTwitterFacebookLinkedInGitHubStar
nanocosmos GmbH
Copyright © 2023 nanocosmos GmbH - doc version Mon Sep 11 2023 09:43:20 GMT+0000 (Coordinated Universal Time)