Skip to content

Commit

Permalink
Fix for min api key
Browse files Browse the repository at this point in the history
  • Loading branch information
markvdouw committed Nov 2, 2023
1 parent 13d425c commit e0bbf4a
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/main/kotlin/com/mparticle/kits/ApptentiveKit.kt
Original file line number Diff line number Diff line change
Expand Up @@ -245,20 +245,23 @@ class ApptentiveKit : KitIntegration(), KitIntegration.EventListener, IdentityLi
}

private fun setUserIdentity(user: MParticleUser?) {
user?.userIdentities?.entries?.forEach {
when (it.key) {
IdentityType.CustomerId -> {
if (KitUtils.isEmpty(Apptentive.getPersonName())) {
// Use id as customer name if no full name is set yet.
Logger.debug("Setting customer id as user name ${it.value}")
Apptentive.setPersonName(it.value)
user?.userIdentities?.entries?.let {
for(i in it.indices){
val entry = it.elementAt(i)
when (entry.key) {
IdentityType.CustomerId -> {
if (KitUtils.isEmpty(Apptentive.getPersonName())) {
// Use id as customer name if no full name is set yet.
Logger.debug("Setting customer id as user name ${entry.value}")
Apptentive.setPersonName(entry.value)
}
}
IdentityType.Email -> {
Logger.debug("Setting customer email ${entry.value}")
Apptentive.setPersonEmail(entry.value)
}
else -> Logger.debug("Other identity type")
}
IdentityType.Email -> {
Logger.debug("Setting customer email ${it.value}")
Apptentive.setPersonEmail(it.value)
}
else -> Logger.debug("Other identity type")
}
}
}
Expand Down

0 comments on commit e0bbf4a

Please sign in to comment.