Skip to main content

Installation

Install Contour AI SDK™ using npm

npm install contour-ai-sdk

iOS

Xcode

  • We support Xcode 14 and above.

iOS

  • Minimum version of iOS supported is version 13.

Step 1. Add below code in AppDelegate to add support for Navigation Controller. Replace your project module name as well.

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <ContoursAI_SDK/ContoursAI_SDK-Swift.h>
@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.initialProps = @{};
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName: @"<Your ModuleName>" initialProperties: nil];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:rootViewController];

rootViewController.view = rootView;
self.window.rootViewController = navController;
[self.window makeKeyAndVisible];
return YES;
}

-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
if ([ContoursAIFramework shared].isLandscape) {
return UIInterfaceOrientationMaskLandscapeRight;
} else {
return UIInterfaceOrientationMaskPortrait;
}
}
info

Make sure minimum supported version in the Pod file should be iOS 13.

platform :ios, 13

Steps to install the license

  • Place the licence file anywhere within the Project Bundle.
  • The license file needs to have the name contoursAI.license. If the license file name does not match, it will lead to licensing errors.
  • Make sure that your BundleIdentifier matches the BundleIdentifier that was provided while requesting the license file.

Simulator support

  • Exclude arm64 architecture for simulator in build settings. Add arm64 in the Excluded Architectures section. Please refer below screenshot.

Exclude arm64 support

info

If you are facing issue in running the app on simulator then add below code in your pod file.

post_install do |installer|      
installer.pods_project.build_configurations.each do |config|       
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"      
end
end

Android

Step 1. Update android/app/build.gradle file and add packagingOptions inside android block.

packagingOptions {
pickFirst '/lib/armeabi-v7a/libopencv_java4.so'
pickFirst '/lib/arm64-v8a/libopencv_java4.so'
pickFirst '/lib/x86/libopencv_java4.so'
pickFirst '/lib/x86_64/libopencv_java4.so'
}

Step 2. Add tools:replace="android:allowBackup" under application tag if you face any error related to allowBackup. Also add xmlns:tools="http://schemas.android.com/tools" under manifest tag if not added already.

<application
tools:replace="android:allowBackup">
</application>

Steps to install the license in Android

  • Place the licence file in android/app/src/main/assets.
  • The license file needs to have the name contoursAI.license. If the license file name does not match, it will lead to licensing errors.
  • Make sure that your ApplicationId matches the ApplicationId that was provided while requesting the license file.
note

You will need to acquire a license file to successfully use the Contour AI SDK™. Please contact your CSM at Urban FT to get your license file. You will need to provide your BundleIdentifier or ApplicationID when requesting the license file. Get more information regarding our terms here.