WTWikitudeNativeSDK Class Reference

Inherits from NSObject
Declared in WTWikitudeNativeSDK.h

Other Methods

  renderingMode

Returns the rendering mode that was set when initWithRenderingMode:delegate: was called

@property (nonatomic, assign, readonly) WTRenderingMode renderingMode

Declared In

WTWikitudeNativeSDK.h

  isRunning

Return the current SDK running State. YES if the SDK is running, false otherwise.

@property (nonatomic, assign, readonly) BOOL isRunning

Declared In

WTWikitudeNativeSDK.h

+ sdkVersion

Returns the Wikitude Native SDK version as a formatted string.

The format is ‘major’.‘minor’.‘bugfix’ e.g. 1.0.1

+ (NSString *)sdkVersion

Declared In

WTWikitudeNativeSDK.h

+ SDKBuildInformation

Use this method to get information about the sdk build.

+ (WTSDKBuildInformation *)SDKBuildInformation

Return Value

The current available SDKBuildInformation within the SKD.

Declared In

WTWikitudeNativeSDK.h

+ resolveCaptureDeviceSettings:toSize:targetFrameRate:

Use this method to determine how the given startup configuration values are resolved on the current device.

+ (void)resolveCaptureDeviceSettings:(nullable void ( ^ ) ( WTNativeSDKStartupConfiguration *startupConfiguration ))configurationHandler toSize:(CGSize *)resolution targetFrameRate:(CMTime *)targetFrameRate

Parameters

configurationHandler

A block that can be used to define camera related options that are then resolved to it’s size and frame rate values.

resolution

On return, the size of the camera frame that can be expected at runtime

targetFrameRate

On return, the frame rate at which the camera delivers new frames. In case the SDK is running with WTRenderingMode_Internal, also rendering will run with this frame rate.

Discussion

The configuration handler can be used to define camera related options. Based on these options, camera resolution and frame rate are resolved and returned. Please note that different camera positions can have different resolutions/frame rates. Because of that it’s important to specify the captureDevicePosition in case the front cam is used.

Declared In

WTWikitudeNativeSDK.h

– initWithRenderingMode:delegate:

The designated initializer to create an object of this class.

- (instancetype)initWithRenderingMode:(WTRenderingMode)renderingMode delegate:(id<WTWikitudeNativeSDKDelegate>)delegate

Parameters

renderingMode

The rendering mode that should be used by the Wikitude Native SDK. See WTRenderingMode for more information about the different rendering modes.

delegate

The object that acts as a delegate for the Wikitude Native SDK object.

Return Value

WTWikitudeNativeSDK An object of type WTWikitudeNativeSDK.

Declared In

WTWikitudeNativeSDK.h

– createEAGLView

Factory method to get a pre configured OpenGL ES 2 View object that can be added to the view hierarchy.

This method is only relevant when using the Wikitude Native SDK with WTRenderingMode_Internal. After retrieving a pointer to a WTEAGLView, the renderer property has to be set before start:completion: is called.

- (WTEAGLView *)createEAGLView

Return Value

WTEAGLView A weak pointer to a Open GL ES 2 view.

Discussion

Please note that the returned pointer is of type weak and the view has either to be added to the view hierarchy within the scope of the calling method or retained (assign to a strong property) until the view was added to the view hierarchy.

Declared In

WTWikitudeNativeSDK.h

– createRenderer

Factory method to get a pre configured render object that is used by a WTEAGLView object.

This method is only relevant when using the Wikitude Native SDK with WTRenderingMode_Internal.

- (WTRenderer *)createRenderer

Return Value

WTRenderer A weak pointer to a WTRenderer object.

Discussion

A WTRenderer object coordinates and initializes internal rendering. Please note that the returned object is already fully configured and no customization is needed.

Declared In

WTWikitudeNativeSDK.h

– trackerManager

Provides access to a WTTrackerManager object that coordinates tracker creation

Please refer to the WTTrackerManager documentation for more information about how to create different tracker types.

- (WTTrackerManager *)trackerManager

Return Value

A object of type WTTrackerManager that provides factory methods to create different tracker types.

Declared In

WTWikitudeNativeSDK.h

– trackingMapRecorder

Provides access to a WTTrackingMapRecorder object that coordinates recording of 3D tracking maps.

Please refer to the WTTrackingMapRecorder documentation for more information about how to record 3D tracking maps.

- (WTTrackingMapRecorder *)trackingMapRecorder

Return Value

A object of type WTTrackingMapRecorder to control 3D tracking map recording.

Declared In

WTWikitudeNativeSDK.h

– captureDeviceManager

Provides access to a WTCaptureDeviceManager if and only if the Wikitude Native SDK is currently running.

- (nullable WTCaptureDeviceManager *)captureDeviceManager

Return Value

A valid pointer to a WTCaptureDeviceManger object if the Wikitude Native SDK is running, nil otherwise.

Discussion

WTCaptureDeviceManager objects can be used to change camera specific settings during Wikitude Native SDK runtime. To start the Wikitude Native SDK with non default camera parameter, please use the WTStartupConfiguration object that is passed to the startupHandler object when calling start:completion:

Declared In

WTWikitudeNativeSDK.h

– setLicenseKey:

Enables SDK features based on the given license key.

- (void)setLicenseKey:(NSString *)licenseKey

Parameters

licenseKey

Your developer key, provided with your licence information.

Discussion

Depending on the license key, different types of watermarks are drawn, depending on the usage of licensed features or not. When this method is not called at all, only the camera stream is rendered but nothing else will be enabled. To try out all Wikitude Native SDK features, download a trial license from our webpage and call this method with the downloaded key.

Declared In

WTWikitudeNativeSDK.h

– start:completion:

Starts Wikitude Native SDK rendering and internal updates.

This method has to be called whenever the hosting view controllers view becomes visible or the application becomes active.

- (void)start:(nullable void ( ^ ) ( WTNativeSDKStartupConfiguration *configuration ))startupHandler completion:(void ( ^ ) ( BOOL isRunning , NSError *error ))completionHandler

Parameters

startupHandler

A block object that can be used to alter the Wikitude Native SDK startup behaviour

completionHandler

A block object that can be used to evaluate if the Wikitude Native SDK could be started or not with the given startup configuration.

Discussion

Since some Wikitude Native SDK internal components start asynchronously, isRunning might be set to YES but an internal error is reported once a component encounters an error.

Declared In

WTWikitudeNativeSDK.h

– stop

Stops Wikitude Native SDK rendering and internal updates.

This method has to be called whenever the hosting view controllers view becomes not visible anymore or the application resigns active state.

- (void)stop

Discussion

When the hosting application resigns active state and the Wikitude Native SDK is still running, the behaviour is undefined.

Declared In

WTWikitudeNativeSDK.h

– shouldTransitionToSize:withTransitionCoordinator:

Call this method when the hosting view controller changes it’s size.

- (void)shouldTransitionToSize:(CGSize)size withTransitionCoordinator:(nullable id<UIViewControllerTransitionCoordinator>)transitionCoordinator

Parameters

size

The new size of the Wikitude Native SDK rendering view.

transitionCoordinator

The transition coordinator that coordinates transitioning to the new size

Discussion

This method has to be called every time the rendering view, which is used by the Wikitude Native SDK, changes it’s size. It might also be necessary to call this mehtod after the Wikitude Native SDK was created and the final view layout was not set yet.

Declared In

WTWikitudeNativeSDK.h

– clearCache

Clears all internal caches used by the SDK.

- (void)clearCache

Declared In

WTWikitudeNativeSDK.h

Plugins Methods

– registerPlugin:error:

Call this method to register a new plugin.

- (BOOL)registerPlugin:(std : : shared_ptr<wikitude::sdk::Plugin>)plugin error:(NSError *__autoreleasing *)error

Parameters

plugin

The plugin that should be registered

error

An error object that will be filled when plugin registration fails

Return Value

BOOL YES if the plugin could be registered successfully, NO otherwise

Discussion

If a plugin with the same identifier is already registered, NO is returned, YES otherwise.

Declared In

WTWikitudeNativeSDK+Plugins.h

– registerPlugin:

Call this method to register a new plugin. (Deprecated: Since version 2.1.0. Use -registerPlugin:plugin:error: instead.)

- (BOOL)registerPlugin:(std : : shared_ptr<wikitude::sdk::Plugin>)plugin

Parameters

plugin

The plugin that should be registered

Return Value

BOOL YES if the plugin could be registered successfully, NO otherwise

Discussion

If a plugin with the same identifier is already registered, NO is returned, YES otherwise.

Declared In

WTWikitudeNativeSDK+Plugins.h

– removePlugin:

Call this method to remove an already registered plugin.

- (BOOL)removePlugin:(std : : shared_ptr<wikitude::sdk::Plugin>)plugin

Parameters

plugin

The plugin that should be removed.

Return Value

BOOL YES if the plugin was known and could be removed, NO otherwise.

Discussion

If the given plugin ptr is not registered, NO is returned, YES otherwise.

Declared In

WTWikitudeNativeSDK+Plugins.h

– removeNamedPlugin:

Call this method to remove an already registered plugin.

- (BOOL)removeNamedPlugin:(NSString *)pluginIdentifier

Parameters

pluginIdentifier

The Identifier that uniquely identifies the plugin that should be removed.

Return Value

BOOL YES if the plugin was known and could be removed, NO otherwise.

Discussion

Same as -removePlugin but searches for the plugin to remove by the given identifier. Using this method, no shared_ptr property needs to be added to any object because the Wikitude Native SDK takes ownership of any plugin.

Declared In

WTWikitudeNativeSDK+Plugins.h