@cuby-ui/ar
v1.1.0
Published
AR plugin
Readme
cuby-ar
AR plugin
Install
latest- stable release versions.beta- development/testing versions.
Examples:
npm i @cuby-ui/ar@latest
npm i @cuby-ui/ar@betaAPI
startAR()isARAvailable()addOnScreenDebugMessage(...)addListener(string, ...)setJsonData(...)- Interfaces
startAR()
startAR() => Promise<void>Launches the Unreal AR activity.
isARAvailable()
isARAvailable() => Promise<{ available: boolean; }>Checks whether AR is available on the current device.
Returns: Promise<{ available: boolean; }>
addOnScreenDebugMessage(...)
addOnScreenDebugMessage(options: { message: string; duration?: number; }) => Promise<void>Sends a message to native code to be logged.
| Param | Type | Description |
| ------------- | ---------------------------------------------------- | ------------------------------------------------------------------- |
| options | { message: string; duration?: number; } | The message to log and optional duration in seconds (default is 5). |
addListener(string, ...)
addListener(eventName: string, listenerFunc: (event: { data: string; }) => void) => PluginListenerHandleListens for events from the native AR activity.
| Param | Type | Description |
| ------------------ | -------------------------------------------------- | -------------------------------------------------------------------------------- |
| eventName | string | The name of the event to listen for. |
| listenerFunc | (event: { data: string; }) => void | The function to call when the event occurs, receiving an event object with data. |
Returns: PluginListenerHandle
setJsonData(...)
setJsonData(options: { data: string; }) => Promise<void>Sets the JSON data in native code.
| Param | Type | Description |
| ------------- | ------------------------------ | ------------------------------------- |
| options | { data: string; } | An object containing the JSON string. |
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
