@@ -26,10 +26,7 @@ import java.util.Objects
2626 * This class handles user resolution and attribute preparation before delegating
2727 * to the underlying Rokt Kit implementation.
2828 */
29- internal class RoktKitApiImpl (
30- private val roktListener : KitIntegration .RoktListener ,
31- private val kitIntegration : KitIntegration ,
32- ) : RoktKitApi {
29+ internal class RoktKitApiImpl (private val roktListener : KitIntegration .RoktListener , private val kitIntegration : KitIntegration ) : RoktKitApi {
3330
3431 override fun execute (
3532 viewName : String ,
@@ -70,14 +67,12 @@ internal class RoktKitApiImpl(
7067 }
7168 }
7269
73- override fun events (identifier : String ): Flow <RoktEvent > {
74- return try {
75- Logger .verbose(" Calling events for Rokt Kit with identifier: $identifier " )
76- roktListener.events(identifier)
77- } catch (e: Exception ) {
78- Logger .warning(" Failed to call events for Rokt Kit: ${e.message} " )
79- flowOf()
80- }
70+ override fun events (identifier : String ): Flow <RoktEvent > = try {
71+ Logger .verbose(" Calling events for Rokt Kit with identifier: $identifier " )
72+ roktListener.events(identifier)
73+ } catch (e: Exception ) {
74+ Logger .warning(" Failed to call events for Rokt Kit: ${e.message} " )
75+ flowOf()
8176 }
8277
8378 override fun purchaseFinalized (placementId : String , catalogItemId : String , status : Boolean ) {
@@ -104,13 +99,11 @@ internal class RoktKitApiImpl(
10499 }
105100 }
106101
107- override fun getSessionId (): String? {
108- return try {
109- roktListener.sessionId
110- } catch (e: Exception ) {
111- Logger .warning(" Failed to call getSessionId for Rokt Kit: ${e.message} " )
112- null
113- }
102+ override fun getSessionId (): String? = try {
103+ roktListener.sessionId
104+ } catch (e: Exception ) {
105+ Logger .warning(" Failed to call getSessionId for Rokt Kit: ${e.message} " )
106+ null
114107 }
115108
116109 override fun prepareAttributesAsync (attributes : Map <String , String >) {
@@ -149,10 +142,7 @@ internal class RoktKitApiImpl(
149142 return null
150143 }
151144
152- private fun prepareAttributes (
153- finalAttributes : MutableMap <String , String >,
154- user : MParticleUser ? ,
155- ): MutableMap <String , String > {
145+ private fun prepareAttributes (finalAttributes : MutableMap <String , String >, user : MParticleUser ? ): MutableMap <String , String > {
156146 val kitConfig = kitIntegration.configuration
157147 val jsonArray = try {
158148 kitConfig?.placementAttributesMapping ? : org.json.JSONArray ()
@@ -227,7 +217,8 @@ internal class RoktKitApiImpl(
227217 } else if (hashedEmailMismatch && existingHashedEmail != null ) {
228218 // If there's an existing other but it doesn't match the passed-in hashed email, log a warning
229219 Logger .warning(
230- " The existing hashed email on the user ($existingHashedEmail ) does not match the hashed email passed to selectPlacements ($hashedEmail ). " +
220+ " The existing hashed email on the user ($existingHashedEmail ) does not match " +
221+ " the hashed email passed to selectPlacements ($hashedEmail ). " +
231222 " Please make sure to sync the hashed email identity to mParticle as soon as it's available. " +
232223 " Identifying user with the provided hashed email before continuing to selectPlacements." ,
233224 )
0 commit comments