diff --git a/kits/matrix.json b/kits/matrix.json index 87a5608f0..6feaee80f 100644 --- a/kits/matrix.json +++ b/kits/matrix.json @@ -122,9 +122,7 @@ { "name": "rokt", "local_path": "kits/rokt/rokt", - "kit_project": ":kits:android-rokt:rokt", - "example_kotlin_project": ":kits:android-rokt:rokt:example-kotlin", - "skip_example_builds": true + "kit_project": ":kits:android-rokt:rokt" }, { "name": "singular-12", diff --git a/kits/rokt/rokt/example/example-kotlin/README.md b/kits/rokt/rokt/example/example-kotlin/README.md new file mode 100644 index 000000000..e3f9aec30 --- /dev/null +++ b/kits/rokt/rokt/example/example-kotlin/README.md @@ -0,0 +1,73 @@ +# Rokt Kit Kotlin Example + +Standalone sample app for exercising the Rokt Kit through the mParticle SDK +(identify, user attributes, overlay and embedded placements, event stream). + +This module is built standalone (own Gradle wrapper and settings) because the +Rokt SDK requires a newer AGP than the shared multi-kit build. It depends on the +single `com.rokt:rokt-sdk-plus` umbrella, which transitively provides +`android-core`, `android-rokt-kit`, `com.rokt:roktsdk`, and +`com.rokt:payment-extension`. + +## Setup + +1. Set the mParticle credentials: either replace the `DEFAULT_API_KEY` / + `DEFAULT_API_SECRET` placeholders in `ExampleApplication.kt`, or enter them + in the input fields at the top of the app and tap "Apply credentials" + (switches the workspace at runtime via `MParticle.switchWorkspace`, no + restart needed). +2. Replace the placement identifier placeholders in `MainActivity.kt` + (`REPLACE_WITH_OVERLAY_VIEW_NAME`, `REPLACE_WITH_BOTTOM_SHEET_VIEW_NAME`, + `REPLACE_WITH_EMBEDDED_VIEW_NAME`) and, if needed, the embedded placeholder + name (`Location1`). +3. Build and install: + + ```bash + ./gradlew installDebug + ``` + +The Rokt account id and the Stripe publishable key are not configured in the +app: both arrive with the kit configuration for the selected workspace. + +The `com.rokt:rokt-sdk-plus` umbrella is not published to Maven Central, so the +example is built against a locally published copy (see below). The published +`com.rokt:payment-extension` / `com.rokt:roktsdk` it pulls in transitively come +from Maven Central. + +## Joint testing against local builds + +The umbrella (and the mParticle core + Rokt kit it bundles) are published to +Maven Local, then the example resolves them at the local version (`0.0.0`): + +```bash +# from the repository root +./gradlew publishMavenPublicationToMavenLocal +./gradlew -c settings-kits.gradle :kits:android-rokt:rokt:publishMavenPublicationToMavenLocal \ + -Pmparticle.kit.mparticleFromMavenLocalOnly=true +./gradlew -c settings-rokt-sdk-plus.gradle :rokt-sdk-plus:publishMavenPublicationToMavenLocal + +# from this directory +./gradlew installDebug -PmparticleVersion=0.0.0 +``` + +Maven Local is resolved first, so locally published `com.rokt` artifacts +(e.g. a locally built `roktsdk` or `roktux`) also take precedence over Maven +Central when present. + +## What to verify + +- Identify runs at startup (`ExampleApplication`) with a test email and + customer id; user attributes are set once the identity resolves. +- "Apply credentials" switches to another workspace at runtime and the kit + re-initializes with that workspace's Rokt account. +- "Show overlay placement" and "Show bottom sheet placement" trigger + `selectPlacements` for overlay-style layouts. +- "Show embedded placement" passes a `RoktEmbeddedView` placeholder; the + height callback is logged. +- Placement events are collected from the kit's event flow and logged with + the `RoktKitExample` tag. +- "Close placements" dismisses any active overlay placement. + +Debug builds trust user-installed CA certificates +(`network_security_config.xml`), so HTTPS traffic can be inspected with tools +like Proxyman or Charles. diff --git a/kits/rokt/rokt/example/example-kotlin/build.gradle b/kits/rokt/rokt/example/example-kotlin/build.gradle index 9911b21f7..d32537caf 100644 --- a/kits/rokt/rokt/example/example-kotlin/build.gradle +++ b/kits/rokt/rokt/example/example-kotlin/build.gradle @@ -1,15 +1,30 @@ plugins { - id 'com.android.application' - id 'org.jetbrains.kotlin.android' + id 'com.android.application' version '8.9.1' + id 'org.jetbrains.kotlin.android' version '2.1.20' +} + +// Standalone build: the Rokt SDK requires a newer AGP than the shared +// multi-kit build, so this example resolves the published Rokt SDK+ umbrella +// (mavenLocal first) instead of the in-repo kit project. +def mparticleVersion = providers.gradleProperty('mparticleVersion').getOrElse('6.0.0-rc.1') + +configurations.all { + resolutionStrategy { + // android-rokt-kit floats android-kit-base with a dynamic '+' version, which would + // otherwise pull a higher published core/kit-base from Maven Central instead of the + // locally published build. Pin the mParticle chain to the umbrella's version. + force "com.mparticle:android-core:${mparticleVersion}" + force "com.mparticle:android-kit-base:${mparticleVersion}" + } } android { namespace 'com.mparticle.kits.rokt.example.kotlin' - compileSdk 35 + compileSdk 36 defaultConfig { applicationId 'com.mparticle.kits.rokt.example.kotlin' - minSdk 21 + minSdk 23 targetSdk 35 versionCode 1 versionName '1.0' @@ -32,7 +47,10 @@ android { } dependencies { - implementation project(':kits:rokt:rokt') + // Rokt SDK+ umbrella: transitively provides android-core, android-rokt-kit, + // com.rokt:roktsdk, and com.rokt:payment-extension. + implementation "com.rokt:rokt-sdk-plus:${mparticleVersion}" implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0' implementation 'com.google.android.material:material:1.11.0' } diff --git a/kits/rokt/rokt/example/example-kotlin/gradle.properties b/kits/rokt/rokt/example/example-kotlin/gradle.properties new file mode 100644 index 000000000..c33552957 --- /dev/null +++ b/kits/rokt/rokt/example/example-kotlin/gradle.properties @@ -0,0 +1,2 @@ +android.useAndroidX=true +org.gradle.jvmargs=-Xmx2g diff --git a/kits/rokt/rokt/example/example-kotlin/gradle/wrapper/gradle-wrapper.jar b/kits/rokt/rokt/example/example-kotlin/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 000000000..41d9927a4 Binary files /dev/null and b/kits/rokt/rokt/example/example-kotlin/gradle/wrapper/gradle-wrapper.jar differ diff --git a/kits/rokt/rokt/example/example-kotlin/gradle/wrapper/gradle-wrapper.properties b/kits/rokt/rokt/example/example-kotlin/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..81aa1c044 --- /dev/null +++ b/kits/rokt/rokt/example/example-kotlin/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/kits/rokt/rokt/example/example-kotlin/gradlew b/kits/rokt/rokt/example/example-kotlin/gradlew new file mode 100755 index 000000000..1b6c78733 --- /dev/null +++ b/kits/rokt/rokt/example/example-kotlin/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/kits/rokt/rokt/example/example-kotlin/gradlew.bat b/kits/rokt/rokt/example/example-kotlin/gradlew.bat new file mode 100644 index 000000000..107acd32c --- /dev/null +++ b/kits/rokt/rokt/example/example-kotlin/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/kits/rokt/rokt/example/example-kotlin/settings.gradle b/kits/rokt/rokt/example/example-kotlin/settings.gradle new file mode 100644 index 000000000..cff31a55a --- /dev/null +++ b/kits/rokt/rokt/example/example-kotlin/settings.gradle @@ -0,0 +1,17 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +dependencyResolutionManagement { + repositories { + mavenLocal() + google() + mavenCentral() + } +} + +rootProject.name = 'rokt-kit-example-kotlin' diff --git a/kits/rokt/rokt/example/example-kotlin/src/main/AndroidManifest.xml b/kits/rokt/rokt/example/example-kotlin/src/main/AndroidManifest.xml index 84b1637c1..7ef7e3b51 100644 --- a/kits/rokt/rokt/example/example-kotlin/src/main/AndroidManifest.xml +++ b/kits/rokt/rokt/example/example-kotlin/src/main/AndroidManifest.xml @@ -6,9 +6,10 @@ android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" + android:networkSecurityConfig="@xml/network_security_config" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:theme="@style/Theme.AppCompat.Light.DarkActionBar"> + android:theme="@style/Theme.AppCompat.Light.NoActionBar"> diff --git a/kits/rokt/rokt/example/example-kotlin/src/main/kotlin/com/mparticle/kits/rokt/example/kotlin/ExampleApplication.kt b/kits/rokt/rokt/example/example-kotlin/src/main/kotlin/com/mparticle/kits/rokt/example/kotlin/ExampleApplication.kt index 3ad7c5f80..d47aa8736 100644 --- a/kits/rokt/rokt/example/example-kotlin/src/main/kotlin/com/mparticle/kits/rokt/example/kotlin/ExampleApplication.kt +++ b/kits/rokt/rokt/example/example-kotlin/src/main/kotlin/com/mparticle/kits/rokt/example/kotlin/ExampleApplication.kt @@ -1,24 +1,56 @@ package com.mparticle.kits.rokt.example.kotlin import android.app.Application -import com.mparticle.MPEvent +import android.content.Context import com.mparticle.MParticle import com.mparticle.MParticleOptions +import com.mparticle.identity.IdentityApiRequest class ExampleApplication : Application() { override fun onCreate() { super.onCreate() - val options = - MParticleOptions - .builder(this) - .credentials( - "REPLACE WITH YOUR MPARTICLE API KEY", - "REPLACE WITH YOUR MPARTICLE API SECRET", - ).logLevel(MParticle.LogLevel.VERBOSE) + val prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE) + val apiKey = prefs.getString(PREF_API_KEY, null)?.takeIf { it.isNotBlank() } ?: DEFAULT_API_KEY + val apiSecret = prefs.getString(PREF_API_SECRET, null)?.takeIf { it.isNotBlank() } ?: DEFAULT_API_SECRET + MParticle.start(buildOptions(this, apiKey, apiSecret)) + registerAttributeListener() + } + + companion object { + const val TEST_EMAIL = "jenny.smith@example.com" + const val TEST_CUSTOMER_ID = "rokt-kit-example-customer" + + const val PREFS_NAME = "example_config" + const val PREF_API_KEY = "mparticle_api_key" + const val PREF_API_SECRET = "mparticle_api_secret" + const val DEFAULT_API_KEY = "REPLACE_WITH_MPARTICLE_API_KEY" + const val DEFAULT_API_SECRET = "REPLACE_WITH_MPARTICLE_API_SECRET" + + fun buildOptions(context: Context, apiKey: String, apiSecret: String): MParticleOptions { + val identifyRequest = + IdentityApiRequest + .withEmptyUser() + .email(TEST_EMAIL) + .customerId(TEST_CUSTOMER_ID) + .build() + return MParticleOptions + .builder(context) + .credentials(apiKey, apiSecret) + .identify(identifyRequest) + .logLevel(MParticle.LogLevel.VERBOSE) .build() - MParticle.start(options) - MParticle.getInstance()?.logEvent( - MPEvent.Builder("foo", MParticle.EventType.Other).build(), - ) + } + + fun registerAttributeListener() { + MParticle.getInstance()?.Identity()?.addIdentityStateListener { user, _ -> + user.setUserAttributes( + mapOf( + "firstname" to "Jenny", + "lastname" to "Smith", + "mobile" to "5551234567", + ), + ) + } + } } } diff --git a/kits/rokt/rokt/example/example-kotlin/src/main/kotlin/com/mparticle/kits/rokt/example/kotlin/MainActivity.kt b/kits/rokt/rokt/example/example-kotlin/src/main/kotlin/com/mparticle/kits/rokt/example/kotlin/MainActivity.kt index bcb3ca57a..8ee61b4fa 100644 --- a/kits/rokt/rokt/example/example-kotlin/src/main/kotlin/com/mparticle/kits/rokt/example/kotlin/MainActivity.kt +++ b/kits/rokt/rokt/example/example-kotlin/src/main/kotlin/com/mparticle/kits/rokt/example/kotlin/MainActivity.kt @@ -1,11 +1,122 @@ package com.mparticle.kits.rokt.example.kotlin +import android.content.Context import android.os.Bundle +import android.util.Log +import android.widget.Button +import android.widget.EditText +import android.widget.Toast import androidx.appcompat.app.AppCompatActivity +import androidx.lifecycle.lifecycleScope +import com.mparticle.MParticle +import com.mparticle.kits.MParticleRokt +import com.mparticle.kits.RoktEmbeddedView +import com.mparticle.kits.RoktLayoutDimensionCallBack +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch +import java.lang.ref.WeakReference class MainActivity : AppCompatActivity() { + private val observedIdentifiers = mutableSetOf() + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) + + setUpCredentialFields() + + val embeddedView = findViewById(R.id.rokt_embedded_view) + embeddedView.dimensionCallBack = + object : RoktLayoutDimensionCallBack { + override fun onHeightChanged(height: Int) { + Log.d(TAG, "Embedded placement height changed: $height") + } + } + + findViewById