Skip to content

Commit 375b92b

Browse files
feat: Add sandbox mode to attributes
1 parent e53cf1c commit 375b92b

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/main/kotlin/com/mparticle/kits/RoktKit.kt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import android.graphics.Typeface
88
import android.os.Build
99
import com.mparticle.commerce.CommerceEvent
1010
import com.mparticle.identity.MParticleUser
11+
import com.mparticle.internal.Constants
1112
import com.mparticle.internal.Logger
1213
import com.mparticle.kits.KitIntegration.CommerceListener
1314
import com.mparticle.kits.KitIntegration.IdentityListener
@@ -141,8 +142,10 @@ class RoktKit : KitIntegration(), CommerceListener, IdentityListener, RoktListen
141142
onShouldHideLoadingIndicatorCallback = onShouldHideLoadingIndicator
142143
onShouldShowLoadingIndicatorCallback = onShouldShowLoadingIndicator
143144
val finalAttributes: HashMap<String, String> = HashMap<String, String>()
145+
Logger.error("userAttributes -> " + filterUser?.toString())
144146
filterUser?.userAttributes?.let { userAttrs ->
145147
for ((key, value) in userAttrs) {
148+
Logger.error("userAttrs -> $key: $value")
146149
finalAttributes[key] = value.toString()
147150
}
148151
}
@@ -155,6 +158,12 @@ class RoktKit : KitIntegration(), CommerceListener, IdentityListener, RoktListen
155158
Logger.warning("RoktKit: No user ID available for placement")
156159
}
157160

161+
162+
val SANDBOX_MODE_ROKT: String = "sandbox"
163+
attributes?.get(SANDBOX_MODE_ROKT)?.let { value ->
164+
finalAttributes.put(SANDBOX_MODE_ROKT, value)
165+
}
166+
158167
Rokt.execute(
159168
viewName,
160169
finalAttributes,
@@ -184,19 +193,19 @@ class RoktKit : KitIntegration(), CommerceListener, IdentityListener, RoktListen
184193
const val NO_APP_VERSION_FOUND = "No App version found, can't initialize kit."
185194
}
186195

187-
override fun onLoad() : Unit{
196+
override fun onLoad(): Unit {
188197
onLoadCallback?.run()
189198
}
190199

191-
override fun onShouldHideLoadingIndicator() : Unit {
200+
override fun onShouldHideLoadingIndicator(): Unit {
192201
onShouldHideLoadingIndicatorCallback?.run()
193202
}
194203

195-
override fun onShouldShowLoadingIndicator() : Unit {
204+
override fun onShouldShowLoadingIndicator(): Unit {
196205
onShouldShowLoadingIndicatorCallback?.run()
197206
}
198207

199-
override fun onUnload(reason: Rokt.UnloadReasons) : Unit {
208+
override fun onUnload(reason: Rokt.UnloadReasons): Unit {
200209
onUnloadCallback?.run()
201210
}
202211
}

0 commit comments

Comments
 (0)