Skip to content

Commit d41dab3

Browse files
committed
Add Rokt overlay placement post checkout
1 parent ced1845 commit d41dab3

File tree

1 file changed

+18
-0
lines changed
  • core-sdk-samples/higgs-shop-sample-app/app/src/main/kotlin/com/mparticle/example/higgsshopsampleapp/activities

1 file changed

+18
-0
lines changed

core-sdk-samples/higgs-shop-sample-app/app/src/main/kotlin/com/mparticle/example/higgsshopsampleapp/activities/CheckoutActivity.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ import com.mparticle.example.higgsshopsampleapp.databinding.ActivityCheckoutBind
4040
import com.mparticle.example.higgsshopsampleapp.repositories.database.entities.CartItemEntity
4141
import com.mparticle.example.higgsshopsampleapp.utils.Constants
4242
import com.mparticle.example.higgsshopsampleapp.viewmodels.CheckoutViewModel
43+
import com.mparticle.rokt.RoktConfig
44+
import java.lang.ref.WeakReference
4345
import java.math.BigDecimal
4446
import java.util.*
4547

@@ -89,6 +91,7 @@ class CheckoutActivity : AppCompatActivity() {
8991
checkoutViewModel.checkOutLiveData.observe(this) { checkedOut ->
9092
if (checkedOut) {
9193
showPurchaseAlert()
94+
showRoktPlacement()
9295
}
9396
}
9497

@@ -100,6 +103,21 @@ class CheckoutActivity : AppCompatActivity() {
100103
return super.onSupportNavigateUp()
101104
}
102105

106+
private fun showRoktPlacement() {
107+
val attributes = mapOf(
108+
"email" to "[email protected]",
109+
"firstname" to "Jenny",
110+
"lastname" to "Smith",
111+
"billingzipcode" to "90210",
112+
"confirmationref" to "54321",
113+
)
114+
115+
MParticle.getInstance()?.Rokt()?.selectPlacements(
116+
identifier = "MSDKOverlayLayout",
117+
attributes = attributes,
118+
)
119+
}
120+
103121
fun showPurchaseAlert() {
104122
val snackbar = Snackbar.make(
105123
binding.root,

0 commit comments

Comments
 (0)