@@ -52,6 +52,7 @@ class RoktKit :
52
52
Rokt .RoktCallback {
53
53
private var applicationContext: Context ? = null
54
54
private var mpRoktEventCallback: MpRoktEventCallback ? = null
55
+ private var hashedEmailUserIdentityType: String? = null
55
56
override fun getName (): String = NAME
56
57
57
58
override fun getInstance (): RoktKit = this
@@ -62,6 +63,7 @@ class RoktKit :
62
63
if (KitUtils .isEmpty(roktTagId)) {
63
64
throwOnKitCreateError(NO_ROKT_ACCOUNT_ID )
64
65
}
66
+ hashedEmailUserIdentityType = settings[HASHED_EMAIL_USER_IDENTITY_TYPE ]
65
67
applicationContext?.let {
66
68
val manager = context.packageManager
67
69
if (roktTagId != null ) {
@@ -204,6 +206,7 @@ class RoktKit :
204
206
}
205
207
verifyHashedEmail(finalAttributes)
206
208
val roktConfig = mpRoktConfig?.let { mapToRoktConfig(it) }
209
+
207
210
Rokt .execute(
208
211
viewName,
209
212
finalAttributes,
@@ -307,7 +310,11 @@ class RoktKit :
307
310
if (filterUser != null ) {
308
311
for ((identityNumberKey, identityValue) in filterUser.userIdentities) {
309
312
val identityType = getStringForIdentity(identityNumberKey)
310
- identityAttributes[identityType] = identityValue
313
+ if (identityType.equals(hashedEmailUserIdentityType)) {
314
+ identityAttributes[" emailsha256" ] = identityValue
315
+ } else {
316
+ identityAttributes[identityType] = identityValue
317
+ }
311
318
}
312
319
}
313
320
if (attributes != null ) {
@@ -341,34 +348,35 @@ class RoktKit :
341
348
}
342
349
343
350
private fun getStringForIdentity (identityType : IdentityType ): String = when (identityType) {
344
- IdentityType .Other -> " emailsha256 "
345
- IdentityType .CustomerId -> " customerid "
346
- IdentityType .Facebook -> " facebook "
347
- IdentityType .Twitter -> " twitter "
348
- IdentityType .Google -> " google "
349
- IdentityType .Microsoft -> " microsoft "
350
- IdentityType .Yahoo -> " yahoo "
351
- IdentityType .Email -> " email "
352
- IdentityType .Alias -> " alias "
353
- IdentityType .FacebookCustomAudienceId -> " facebookcustomaudienceid "
354
- IdentityType .Other2 -> " other2 "
355
- IdentityType .Other3 -> " other3 "
356
- IdentityType .Other4 -> " other4 "
357
- IdentityType .Other5 -> " other5 "
358
- IdentityType .Other6 -> " other6 "
359
- IdentityType .Other7 -> " other7 "
360
- IdentityType .Other8 -> " other8 "
361
- IdentityType .Other9 -> " other9 "
362
- IdentityType .Other10 -> " other10 "
363
- IdentityType .MobileNumber -> " mobilenumber "
364
- IdentityType .PhoneNumber2 -> " phonenumber2 "
365
- IdentityType .PhoneNumber3 -> " phonenumber3 "
351
+ IdentityType .Other -> " Other "
352
+ IdentityType .CustomerId -> " CustomerId "
353
+ IdentityType .Facebook -> " Facebook "
354
+ IdentityType .Twitter -> " Twitter "
355
+ IdentityType .Google -> " Google "
356
+ IdentityType .Microsoft -> " Microsoft "
357
+ IdentityType .Yahoo -> " Yahoo "
358
+ IdentityType .Email -> " Email "
359
+ IdentityType .Alias -> " Alias "
360
+ IdentityType .FacebookCustomAudienceId -> " FacebookCustomAudienceId "
361
+ IdentityType .Other2 -> " Other2 "
362
+ IdentityType .Other3 -> " Other3 "
363
+ IdentityType .Other4 -> " Other4 "
364
+ IdentityType .Other5 -> " Other5 "
365
+ IdentityType .Other6 -> " Other6 "
366
+ IdentityType .Other7 -> " Other7 "
367
+ IdentityType .Other8 -> " Other8 "
368
+ IdentityType .Other9 -> " Other9 "
369
+ IdentityType .Other10 -> " Other10 "
370
+ IdentityType .MobileNumber -> " MobileNumber "
371
+ IdentityType .PhoneNumber2 -> " PhoneNumber2 "
372
+ IdentityType .PhoneNumber3 -> " PhoneNumber3 "
366
373
else -> " "
367
374
}
368
375
369
376
companion object {
370
377
const val NAME = " Rokt"
371
378
const val ROKT_ACCOUNT_ID = " accountId"
379
+ const val HASHED_EMAIL_USER_IDENTITY_TYPE = " hashedEmailUserIdentityType"
372
380
const val MPID = " mpid"
373
381
const val NO_ROKT_ACCOUNT_ID = " No Rokt account ID provided, can't initialize kit."
374
382
const val NO_APP_VERSION_FOUND = " No App version found, can't initialize kit."
0 commit comments