get

fun get(context: Context): TWSManager

Retrieves a TWSManager instance for the default configuration, which is created using metadata from the application's manifest.

To create TWSManager without providing configuration manually, you must define the required metadata in your AndroidManifest.xml file:

<application>
<!-- Other application elements -->
<meta-data
android:name="com.thewebsnippet.PROJECT_ID"
android:value="your_project_id_here" />
</application>

Return

A TWSManager instance associated with the configuration.

Parameters

context

The application context.

Throws

if required metadata is missing in the Android Manifest.


fun get(context: Context, configuration: TWSConfiguration.Basic): TWSManager

Retrieves a TWSManager instance for a custom TWSConfiguration.Basic.

Return

A TWSManager instance associated with the provided configuration.

Parameters

context

The application context.

configuration

The basic configuration containing project ID.


fun get(context: Context, configuration: TWSConfiguration.Shared): TWSManager

Retrieves a TWSManager instance for a custom TWSConfiguration.Shared.

Return

A TWSManager instance associated with the provided configuration.

Parameters

context

The application context.

configuration

The shared configuration containing the shared ID.


fun get(tag: String): TWSManager?

Retrieves an existing TWSManager instance by its tag, if available.

Return

The TWSManager instance if it exists in the cache, or null otherwise.

Parameters

tag

The unique tag associated with a TWSManager instance.