TWSSdk

object TWSSdk

Entry point for initializing and accessing the TWS SDK.

This singleton provides a globally accessible TWSManager instance, which must be initialized before use via initialize. Depending on your use case, you can provide a custom configuration (TWSConfiguration.Basic or TWSConfiguration.Shared), or let the SDK load it from the AndroidManifest.xml metadata.

Example Usage

// Default initialization using manifest metadata
TWSSdk.initialize(context)
val manager = TWSSdk.getInstance()

// OR initialize with a specific configuration
val config = TWSConfiguration.Basic("your_project_id")
TWSSdk.initialize(context, config)
val manager = TWSSdk.getInstance()

Warning: Must be initialized before calling getInstance, otherwise a no-op implementation is returned.

Functions

Link copied to clipboard
fun displayNotification(context: Context, contentTitle: String, contentText: String, payload: Map<String, String>, smallIcon: Int = R.drawable.ic_default_notification, autoCancel: Boolean = true, priority: Int = NotificationCompat.PRIORITY_HIGH, historyIntents: List<Intent> = emptyList()): Boolean

Handles and displays a push notification using the TWS SDK.

Link copied to clipboard

Retrieves the current TWSManager instance.

Link copied to clipboard
fun initialize(context: Context, configuration: TWSConfiguration? = null)

Initializes the SDK with an optional TWSConfiguration.

Link copied to clipboard

Creates an Intent for displaying the snippet detail screen in response to a notification tap.