-
Notifications
You must be signed in to change notification settings - Fork 70
feat(rokt-sdk-plus): add com.rokt:rokt-sdk-plus umbrella artifact #721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
denischilik
merged 1 commit into
workstation/6.0-Release
from
thomson-t/rokt-sdk-plus-android
Jul 21, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # Rokt SDK+ (Android) | ||
|
|
||
| Rokt SDK+ is a single umbrella artifact that bundles everything needed to run Rokt Shoppable | ||
| Ads through mParticle on Android: | ||
|
|
||
| - the mParticle core SDK (`com.mparticle:android-core`) | ||
| - the mParticle Rokt kit (`com.mparticle:android-rokt-kit`) | ||
| - the Rokt Payment Extension (`com.rokt:payment-extension`, which brings the Rokt SDK, | ||
| Stripe, and Google Pay) | ||
|
|
||
| It is the Android counterpart of the iOS [`RoktSDKPlus`](https://github.com/mParticle/mparticle-apple-sdk/tree/main/Kits/rokt-sdk-plus/rokt-sdk-plus-ios) | ||
| umbrella. Add **one** dependency instead of wiring up core + kit + payment extension by hand, | ||
| with versions guaranteed to be compatible. | ||
|
|
||
| Maven coordinates: **`com.rokt:rokt-sdk-plus`**. | ||
|
|
||
| > The mParticle Rokt kit deliberately does **not** pull the payment extension (and Stripe) | ||
| > transitively, so apps that don't need Shoppable Ads stay lightweight. Rokt SDK+ is the | ||
| > artifact that adds it on top. | ||
|
|
||
| ## Adding the dependency | ||
|
|
||
| ```groovy | ||
| dependencies { | ||
| implementation 'com.rokt:rokt-sdk-plus:6+' | ||
| } | ||
| ``` | ||
|
|
||
| This transitively provides `android-core`, `android-rokt-kit`, `com.rokt:roktsdk`, | ||
| `com.rokt:payment-extension`, Stripe, and Google Pay. You do not need to declare any of those | ||
| separately. | ||
|
|
||
| ## Versioning | ||
|
|
||
| Rokt SDK+ tracks the mParticle Android SDK release line (it shares its version with | ||
| `android-core` and `android-rokt-kit`). The bundled Rokt artifacts (`roktsdk` / | ||
| `payment-extension`) ride their own Rokt release line; the pinned versions live in the repo's | ||
| root `gradle.properties` (`roktSdkVersion`, `roktPaymentExtensionVersion`). | ||
|
|
||
| ## Usage | ||
|
|
||
| Initialize mParticle as usual: | ||
|
|
||
| ```kotlin | ||
| import com.mparticle.MParticle | ||
| import com.mparticle.MParticleOptions | ||
|
|
||
| val options = MParticleOptions.builder(this) | ||
| .credentials("<<<App Key>>>", "<<<App Secret>>>") | ||
| .build() | ||
| MParticle.start(options) | ||
| ``` | ||
|
|
||
| Select Rokt placements through the mParticle Rokt kit facade: | ||
|
|
||
| ```kotlin | ||
| import com.mparticle.kits.rokt | ||
|
|
||
| MParticle.getInstance()?.rokt?.selectPlacements( | ||
| identifier = "RoktExperience", | ||
| attributes = attributes, | ||
| ) | ||
| ``` | ||
|
|
||
| ### Shoppable Ads | ||
|
|
||
| Shoppable Ads use the payment extension bundled by this artifact. Register your payment | ||
| extension once (the Stripe publishable key is supplied from your Rokt kit settings in the | ||
| mParticle dashboard), then select shoppable placements: | ||
|
|
||
| ```kotlin | ||
| MParticle.getInstance()?.rokt?.registerPaymentExtension() | ||
|
|
||
| MParticle.getInstance()?.rokt?.selectShoppableAds( | ||
| identifier = "RoktExperience", | ||
| attributes = attributes, | ||
| ) | ||
| ``` | ||
|
|
||
| > The `registerPaymentExtension` / `selectShoppableAds` facade is provided by the mParticle | ||
| > Rokt kit. They require a kit version that includes Shoppable Ads support | ||
| > (see the kit [README](../kits/rokt/rokt/README.md)). | ||
|
|
||
| ## Documentation | ||
|
|
||
| [Rokt Android integration guide](https://docs.rokt.com/developers/integration-guides/android/overview) | ||
|
|
||
| ## License | ||
|
|
||
| [Rokt SDK License](https://rokt.com/sdk-license-2-0/) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| apply plugin: 'com.android.library' | ||
| apply plugin: 'mparticle.android.library.publish' | ||
|
|
||
| // No Kotlin plugin: the umbrella ships a single Java metadata class (RoktSdkPlus) and only | ||
| // aggregates dependencies. Avoiding the Kotlin toolchain sidesteps a stdlib-metadata version | ||
| // mismatch — the bundled Rokt artifacts are built with Kotlin 2.2, newer than this repo's | ||
| // compiler. Consumers still receive kotlin-stdlib transitively from those artifacts. | ||
|
|
||
| // Rokt SDK+ is a thin umbrella artifact: it ships no runtime logic of its own and simply | ||
| // aggregates the mParticle core SDK, the mParticle Rokt kit, and the Rokt Payment Extension | ||
| // as a single dependency (the Android analog of the iOS `RoktSDKPlus` umbrella). It is NOT a | ||
| // kit, so it applies `com.android.library` + the publish convention plugin directly rather | ||
| // than `com.mparticle.kit`. | ||
|
|
||
| // The umbrella tracks the mParticle SDK release line; the Rokt artifacts ride their own line. | ||
| def mpVersion = (project.findProperty('VERSION') ?: '0.0.0').toString() | ||
| def roktPaymentExtensionVersion = | ||
| (project.findProperty('roktPaymentExtensionVersion') ?: '6.0.1').toString() | ||
|
|
||
| mparticleMavenPublish { | ||
| groupId.set('com.rokt') | ||
| artifactId.set('rokt-sdk-plus') | ||
| description.set('Rokt SDK+ umbrella for Android: bundles the mParticle core SDK, the ' + | ||
| 'mParticle Rokt kit, and the Rokt Payment Extension (Shoppable Ads) as a single dependency.') | ||
| pomUrl.set('https://docs.rokt.com/developers/integration-guides/android/overview') | ||
| licenseName.set('Rokt SDK License') | ||
| licenseUrl.set('https://rokt.com/sdk-license-2-0/') | ||
| } | ||
|
|
||
| android { | ||
| namespace 'com.rokt.sdkplus' | ||
| compileSdk 34 | ||
|
|
||
| compileOptions { | ||
| sourceCompatibility JavaVersion.toVersion(JAVA_VERSION) | ||
| targetCompatibility JavaVersion.toVersion(JAVA_VERSION) | ||
| } | ||
|
|
||
| defaultConfig { | ||
| minSdk 21 | ||
| versionName mpVersion | ||
| versionCode Integer.parseInt(new Date().format('yyyyMMdd')) | ||
| buildConfigField 'String', 'VERSION_NAME', '\"' + mpVersion + '\"' | ||
| } | ||
|
|
||
| buildFeatures { | ||
| buildConfig = true | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| // mParticle artifacts share the umbrella's version (this repo's VERSION). `android-core` | ||
| // is reached transitively through android-rokt-kit -> android-kit-base, but is listed | ||
| // explicitly so the published POM is self-documenting and pins a coherent core version. | ||
| api "com.mparticle:android-core:$mpVersion" | ||
| api "com.mparticle:android-rokt-kit:$mpVersion" | ||
|
|
||
| // The Rokt Payment Extension (Stripe + Google Pay) rides the Rokt SDK release line and | ||
| // pulls com.rokt:roktsdk transitively. This is the dependency the mParticle Rokt kit | ||
| // deliberately omits — adding it here is the whole reason the umbrella exists. | ||
| api "com.rokt:payment-extension:$roktPaymentExtensionVersion" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" /> |
18 changes: 18 additions & 0 deletions
18
rokt-sdk-plus/src/main/java/com/rokt/sdkplus/RoktSdkPlus.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package com.rokt.sdkplus; | ||
|
|
||
| /** | ||
| * Entry-point metadata for the Rokt SDK+ umbrella artifact. | ||
| * | ||
| * <p>Rokt SDK+ ({@code com.rokt:rokt-sdk-plus}) is a single dependency that bundles the mParticle | ||
| * core SDK, the mParticle Rokt kit, and the Rokt Payment Extension (Shoppable Ads). It contains no | ||
| * runtime logic of its own: initialize mParticle and use the Rokt kit APIs | ||
| * ({@code com.mparticle.kits.MParticleRokt.Rokt()}) exactly as you would without the umbrella. | ||
| */ | ||
| public final class RoktSdkPlus { | ||
|
|
||
| private RoktSdkPlus() { | ||
| } | ||
|
|
||
| /** The Rokt SDK+ umbrella version, aligned with the mParticle SDK release line. */ | ||
| public static final String VERSION = BuildConfig.VERSION_NAME; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // Isolated settings for the `com.rokt:rokt-sdk-plus` umbrella artifact. | ||
| // | ||
| // rokt-sdk-plus is intentionally kept OUT of the main settings.gradle so it is not picked up | ||
| // by the com.mparticle-credentialed publish steps. It is built and published in its own Gradle | ||
| // invocation with the Rokt Maven Central credentials — see .github/workflows/release-publish.yml. | ||
| // | ||
| // Its dependencies resolve as follows during a release build: | ||
| // * com.mparticle:android-rokt-kit -> android-kit-base -> android-core ... from mavenLocal | ||
| // (published earlier in the same release run; see the "Publish ... to Maven local" steps) | ||
| // * com.rokt:payment-extension + com.rokt:roktsdk ........................ from Maven Central | ||
| // (released independently from the ROKT sdk-android-source repo) | ||
| include ':rokt-sdk-plus' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.