Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions core-sdk-samples/higgs-shop-sample-app/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

android {
compileSdk = 33
compileSdk = 34
defaultConfig {
applicationId = "com.mparticle.example.higgsshopsampleapp"
minSdk = 24
Expand All @@ -26,9 +26,10 @@ android {
buildFeatures {
dataBinding = true
compose = true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.3.2"
kotlinCompilerExtensionVersion = "1.5.2"
}
kotlinOptions {
jvmTarget = "11"
Expand Down Expand Up @@ -66,7 +67,8 @@ dependencies {
implementation("androidx.navigation:navigation-fragment-ktx:2.5.3")
implementation("androidx.navigation:navigation-ui-ktx:2.5.3")
implementation("com.google.android.material:material:1.7.0")
implementation("com.mparticle:android-core:5.48.0")
implementation("com.mparticle:android-core:5+")
implementation("com.mparticle:android-kit-base:5+")
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")

// implementation(platform("com.google.firebase:firebase-bom:31.0.2"))
Expand All @@ -92,7 +94,7 @@ dependencies {

debugImplementation("androidx.compose.ui:ui-tooling:1.3.0")

val roomVersion = "2.4.3"
val roomVersion = "2.6.1"
implementation("androidx.room:room-runtime:$roomVersion")
// annotationProcessor("androidx.room:room-compiler:$roomVersion")
kapt("androidx.room:room-compiler:$roomVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,23 @@ package com.mparticle.example.higgsshopsampleapp;
import android.app.Application
import com.mparticle.MParticle
import com.mparticle.MParticleOptions
import com.mparticle.networking.NetworkOptions
import com.mparticle.example.higgsshopsampleapp.sideloading_kits.LoggingCustomKit
import com.mparticle.example.higgsshopsampleapp.sideloading_kits.MinimalSideloadingKit

class HiggsShopSampleApplication: Application() {
class HiggsShopSampleApplication : Application() {
val TAG = "HiggsShopSampleApplication"
override fun onCreate() {
super.onCreate()
val options: MParticleOptions = MParticleOptions.builder(this)
.credentials(BuildConfig.HIGGS_SHOP_SAMPLE_APP_KEY, BuildConfig.HIGGS_SHOP_SAMPLE_APP_SECRET)
.credentials(
BuildConfig.HIGGS_SHOP_SAMPLE_APP_KEY,
BuildConfig.HIGGS_SHOP_SAMPLE_APP_SECRET
)
.environment(MParticle.Environment.Development)
.sideloadedKits(listOf(
LoggingCustomKit(1000001), LoggingCustomKit(1000002),
MinimalSideloadingKit(5000000)
))
// Disable SSL pinning for debugging network requests
// .networkOptions(
// NetworkOptions.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class CheckoutActivity : AppCompatActivity() {
snackbar.setTextColor(getColor(R.color.black))
snackbar.setActionTextColor(getColor(R.color.blue_4079FE))
snackbar.view.setPadding(20, 10, 20, 0)
(snackbar.view.findViewById<TextView>(R.id.snackbar_text))?.textAlignment =
(snackbar.view.findViewById<TextView>(com.google.android.material.R.id.snackbar_text))?.textAlignment =
View.TEXT_ALIGNMENT_TEXT_START
val snackbarActionTextView =
snackbar.view.findViewById<View>(com.google.android.material.R.id.snackbar_action) as TextView
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package com.mparticle.example.higgsshopsampleapp.sideloading_kits

import android.content.Context
import android.util.Log
import com.mparticle.MPEvent
import com.mparticle.internal.CoreCallbacks.KitListener
import com.mparticle.kits.KitIntegration.EventListener
import com.mparticle.kits.MPSideloadedKit
import com.mparticle.kits.ReportingMessage
import java.lang.Exception

class LoggingCustomKit(kitId: Int) : MPSideloadedKit(kitId), KitListener, EventListener {

companion object {
private const val CUSTOM_KIT = "LoggingCustomKit"
}

override fun getName(): String = CUSTOM_KIT

override fun onKitCreate(
settings: MutableMap<String, String>?,
context: Context?
): MutableList<ReportingMessage> {
Log.d(CUSTOM_KIT, "$CUSTOM_KIT onKitCreate")
return mutableListOf()
}

override fun leaveBreadcrumb(breadcrumb: String?): MutableList<ReportingMessage> {
Log.d(CUSTOM_KIT, "$CUSTOM_KIT leaveBreadcrumb with breadcrumb: ${breadcrumb.orEmpty()}")
return mutableListOf()
}

override fun logError(
message: String?,
errorAttributes: MutableMap<String, String>?
): MutableList<ReportingMessage> {
Log.d(CUSTOM_KIT, "$CUSTOM_KIT logError with message: ${message.orEmpty()}")
return mutableListOf()
}

override fun logException(
exception: Exception?,
exceptionAttributes: MutableMap<String, String>?,
message: String?
): MutableList<ReportingMessage> {
Log.d(CUSTOM_KIT, "$CUSTOM_KIT logException with exception: ${exception?.message.orEmpty()} and message: ${message.orEmpty()}")
return mutableListOf()
}

override fun logEvent(baseEvent: MPEvent): MutableList<ReportingMessage>? {
Log.d(CUSTOM_KIT, "$CUSTOM_KIT logEvent with name: ${baseEvent.eventName}")
return super.logEvent(baseEvent)
}

override fun logScreen(
screenName: String?,
screenAttributes: MutableMap<String, String>?
): MutableList<ReportingMessage> {
Log.d(CUSTOM_KIT, "$CUSTOM_KIT logScreen with screen name: ${screenName.orEmpty()}")
return mutableListOf()
}

override fun setOptOut(optedOut: Boolean): MutableList<ReportingMessage> = mutableListOf()

override fun kitFound(kitId: Int) {
Log.d(CUSTOM_KIT, "$CUSTOM_KIT kitFound for kit: $kitId")
}

override fun kitConfigReceived(kitId: Int, p1: String?) {
Log.d(CUSTOM_KIT, "$CUSTOM_KIT kitConfigReceived for kit: $kitId")
}

override fun kitExcluded(kitId: Int, p1: String?) {
Log.d(CUSTOM_KIT, "$CUSTOM_KIT kitExcluded for kit $kitId")
}

override fun kitStarted(kitId: Int) {
Log.d(CUSTOM_KIT, "$CUSTOM_KIT kitStarted for kit: $kitId")
}

override fun onKitApiCalled(kitId: Int, p1: Boolean?, vararg p2: Any?) {
Log.d(CUSTOM_KIT, "$CUSTOM_KIT onKitApiCalled for kit: $kitId")
}

override fun onKitApiCalled(methodName: String?, kitId: Int, p2: Boolean?, vararg p3: Any?) {
Log.d(CUSTOM_KIT, "$CUSTOM_KIT onKitApiCalled for kit: $kitId with method name: ${methodName.orEmpty()}")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.mparticle.example.higgsshopsampleapp.sideloading_kits

import com.mparticle.kits.MPSideloadedKit

class MinimalSideloadingKit(kitId : Int) : MPSideloadedKit(kitId)
4 changes: 2 additions & 2 deletions core-sdk-samples/higgs-shop-sample-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20")
classpath("com.android.tools.build:gradle:7.2.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
classpath("com.google.gms:google-services:4.3.14")
}
}
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.code.style=official
# Enable Jetpack Compose
android.compose.compiler.kotlin.version=1.7.21
8 changes: 8 additions & 0 deletions local.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Wed Mar 12 17:04:50 EDT 2025
sdk.dir=/Users/mpandya/Library/Android/sdk
Loading