@@ -57,6 +57,7 @@ class RoktKit :
57
57
Rokt .RoktCallback {
58
58
private var applicationContext: Context ? = null
59
59
private var mpRoktEventCallback: MpRoktEventCallback ? = null
60
+ private var hashedEmailUserIdentityType: String? = null
60
61
override fun getName (): String = NAME
61
62
62
63
override fun getInstance (): RoktKit = this
@@ -70,6 +71,7 @@ class RoktKit :
70
71
if (KitUtils .isEmpty(roktTagId)) {
71
72
throwOnKitCreateError(NO_ROKT_ACCOUNT_ID )
72
73
}
74
+ hashedEmailUserIdentityType = settings[HASHED_EMAIL_USER_IDENTITY_TYPE ]
73
75
applicationContext?.let {
74
76
val manager = context.packageManager
75
77
if (roktTagId != null ) {
@@ -343,7 +345,11 @@ class RoktKit :
343
345
if (filterUser != null ) {
344
346
for ((identityNumberKey, identityValue) in filterUser.userIdentities) {
345
347
val identityType = getStringForIdentity(identityNumberKey)
346
- identityAttributes[identityType] = identityValue
348
+ if (identityType.equals(hashedEmailUserIdentityType)) {
349
+ identityAttributes[" emailsha256" ] = identityValue
350
+ } else {
351
+ identityAttributes[identityType] = identityValue
352
+ }
347
353
}
348
354
}
349
355
if (attributes != null ) {
@@ -377,28 +383,28 @@ class RoktKit :
377
383
}
378
384
379
385
private fun getStringForIdentity (identityType : IdentityType ): String = when (identityType) {
380
- IdentityType .Other -> " emailsha256 "
381
- IdentityType .CustomerId -> " customerid "
382
- IdentityType .Facebook -> " facebook "
383
- IdentityType .Twitter -> " twitter "
384
- IdentityType .Google -> " google "
385
- IdentityType .Microsoft -> " microsoft "
386
- IdentityType .Yahoo -> " yahoo "
387
- IdentityType .Email -> " email "
388
- IdentityType .Alias -> " alias "
389
- IdentityType .FacebookCustomAudienceId -> " facebookcustomaudienceid "
390
- IdentityType .Other2 -> " other2 "
391
- IdentityType .Other3 -> " other3 "
392
- IdentityType .Other4 -> " other4 "
393
- IdentityType .Other5 -> " other5 "
394
- IdentityType .Other6 -> " other6 "
395
- IdentityType .Other7 -> " other7 "
396
- IdentityType .Other8 -> " other8 "
397
- IdentityType .Other9 -> " other9 "
398
- IdentityType .Other10 -> " other10 "
399
- IdentityType .MobileNumber -> " mobilenumber "
400
- IdentityType .PhoneNumber2 -> " phonenumber2 "
401
- IdentityType .PhoneNumber3 -> " phonenumber3 "
386
+ IdentityType .Other -> " Other "
387
+ IdentityType .CustomerId -> " CustomerId "
388
+ IdentityType .Facebook -> " Facebook "
389
+ IdentityType .Twitter -> " Twitter "
390
+ IdentityType .Google -> " Google "
391
+ IdentityType .Microsoft -> " Microsoft "
392
+ IdentityType .Yahoo -> " Yahoo "
393
+ IdentityType .Email -> " Email "
394
+ IdentityType .Alias -> " Alias "
395
+ IdentityType .FacebookCustomAudienceId -> " FacebookCustomAudienceId "
396
+ IdentityType .Other2 -> " Other2 "
397
+ IdentityType .Other3 -> " Other3 "
398
+ IdentityType .Other4 -> " Other4 "
399
+ IdentityType .Other5 -> " Other5 "
400
+ IdentityType .Other6 -> " Other6 "
401
+ IdentityType .Other7 -> " Other7 "
402
+ IdentityType .Other8 -> " Other8 "
403
+ IdentityType .Other9 -> " Other9 "
404
+ IdentityType .Other10 -> " Other10 "
405
+ IdentityType .MobileNumber -> " MobileNumber "
406
+ IdentityType .PhoneNumber2 -> " PhoneNumber2 "
407
+ IdentityType .PhoneNumber3 -> " PhoneNumber3 "
402
408
else -> " "
403
409
}
404
410
@@ -413,6 +419,7 @@ class RoktKit :
413
419
414
420
const val NAME = " Rokt"
415
421
const val ROKT_ACCOUNT_ID = " accountId"
422
+ const val HASHED_EMAIL_USER_IDENTITY_TYPE = " hashedEmailUserIdentityType"
416
423
const val MPID = " mpid"
417
424
const val NO_ROKT_ACCOUNT_ID = " No Rokt account ID provided, can't initialize kit."
418
425
const val NO_APP_VERSION_FOUND = " No App version found, can't initialize kit."
0 commit comments