build.gradle.ktsbuild.gradle.kts:dependencies { implementation("com.sovendus:android-sdk:1.1.0") }
VoucherBenefits for all Sovendus placements. Each placement gets its own
SovendusConfig with a unique trafficMediumNumber provided by Sovendus.
The component renders whatever the API returns (banner, list, or both).@Composable fun YourScreen() { // Each VoucherBenefits instance uses a unique trafficMediumNumber SovendusSDK.VoucherBenefits( config = SovendusConfig.Builder() .trafficSourceNumber(123) .trafficMediumNumber(
<com.sovendus.sdk.ui.xml.SovendusVoucherBenefitsView android:id="@+id/sovendus_benefits" android:layout_width="match_parent" android:layout_height="wrap_content" />
findViewById<SovendusVoucherBenefitsView>(R.id.sovendus_benefits).apply { config = SovendusConfig.Builder() .trafficSourceNumber(123) .trafficMediumNumber(456)
trafficMediumNumber.val testConfig = SovendusConfig.Builder() .sandbox(true) // Uses test data .build() SovendusSDK.VoucherBenefits(config = testConfig)
val config = SovendusConfig.Builder() .trafficSourceNumber(123) .trafficMediumNumber(456) .consumer(ConsumerData( firstName = "Max", email =
SovendusSDK.VoucherBenefits( config = config, onStateChanged = { state -> when (state) { is LoadingState.Loading -> showYourLoader() is LoadingState
VoucherBenefits instances with different trafficMediumNumber values for
different placements in your app. Sovendus assigns each placement a unique medium number
and configures what content/layout to return via the backend.@Composable fun YourApp() { // Placement 1: Inline benefits list + banner on checkout success page SovendusSDK.VoucherBenefits( config = SovendusConfig.Builder() .trafficSourceNumber(123) .trafficMediumNumber(
@Composable fun ModalPlacement() { var showDialog by remember { mutableStateOf(false) } var dataReady by remember { mutableStateOf(false) }
trafficMediumNumber assigned by Sovendusval config = SovendusConfig.Builder() .trafficSourceNumber(123) .trafficMediumNumber(456) .onLinkOpened { url -> // Custom logic (e.g., Chrome Custom Tabs, in-app browser) openInCustomTabs(url
FontFamily.res/font/ directory (TTF or OTF format):app/src/main/res/font/
├── brand_regular.ttf
└── brand_bold.ttf
import androidx.compose.ui.text.font.Font import androidx.compose.ui.
import androidx.compose.ui.text.ExperimentalTextApi import androidx.compose.ui.text.font.FontVariation @OptIn(ExperimentalTextApi::class) val BrandVariableFontFamily = FontFamily(
fontFamily is not provided (or set to null), the SDK uses the system fontval config = SovendusConfig.Builder() .trafficSourceNumber(123) // Your real traffic source .trafficMediumNumber(456) // Your real traffic medium .debugMode(
@Composable fun CheckoutSuccessScreen() { SovendusSDK.VoucherBenefits( config = SovendusConfig.Builder() .trafficSourceNumber(123) .trafficMediumNumber(456)
@Composable fun CheckoutSuccessScreen() { // Placement 1: Inline content (Sovendus decides what to show) SovendusSDK.VoucherBenefits( config = SovendusConfig.Builder() .trafficSourceNumber(123) .trafficMediumNumber
class CheckoutSuccessActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout
.debugMode(true)VoucherBenefits component is the only component you need for all Sovendus placements.
It automatically renders whatever the API returns for the given trafficMediumNumber:| API Returns | Display |
|---|---|
Products only | Product recommendation list |
Banner only | Voucher banner |
Both | Both with correct positioning |
Nothing | Empty (graceful handling) |
template.layoutId:| Layout ID | Style | Description |
|---|---|---|
1 | Horizontal Slider | Swipeable pager with page indicators (default) |
2 | Vertical List | Two-column cards stacked vertically |
| Layout ID | Style | Description |
|---|---|---|
1 | Inline Banner | Compact horizontal layout with image and CTA (default) |
2 | Overlay Banner | Centered vertical card with prominent image and CTA (ideal for modals) |
template.layoutId)trafficMediumNumber via backend settingsVoucherBenefits component everywhere—inline, in dialogs, in bottom sheets,
or any other placement. Each instance with a different trafficMediumNumber triggers its own
independent API call. Sovendus controls per placement:VoucherBenefits with a dedicated trafficMediumNumber.
Sovendus configures banner-only content with overlay layout (layoutId 2) for that
medium number via the backend.val config = SovendusConfig.Builder() .trafficSourceNumber(123) .trafficMediumNumber(456) .fontFamily(BrandFontFamily) // Custom font .build() SovendusSDK.VoucherBenefits(config = config)
adb logcat | grep SovendusSDK