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
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,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 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
@@ -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)
Loading