You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MPLog.debug("Initializing RoktLayout with arguments:", sdkTriggered.wrappedValue, viewName ??"nil", locationName, preparedAttributes)
35
37
self.roktLayout =RoktLayout.init(
36
38
sdkTriggered: sdkTriggered,
37
39
viewName: viewName,
@@ -40,15 +42,23 @@ public class MPRoktLayout {
40
42
config: config,
41
43
onEvent: onEvent
42
44
)
45
+
// The Binding variable provided by the client allows us to trigger a re-render of the UI but we only want to do this if the value was true to start
46
+
if identifyCalled && sdkTriggered.wrappedValue {
47
+
MPLog.debug("Triggering Rokt Swift UI re-render")
48
+
DispatchQueue.main.async{
49
+
sdkTriggered.wrappedValue =false
50
+
sdkTriggered.wrappedValue =true
51
+
}
52
+
}
43
53
}
44
54
}
45
55
46
56
func confirmUser(
47
57
attributes:[String:String]?,
48
-
completion:@escaping()->Void
58
+
completion:@escaping(Bool)->Void
49
59
){
50
60
guardlet user = mparticle.identity.currentUser else{
51
-
completion()
61
+
completion(false)
52
62
return
53
63
}
54
64
letemail=attributes?["email"]
@@ -76,15 +86,17 @@ public class MPRoktLayout {
76
86
if emailMismatch || hashedEmailMismatch {
77
87
// If there is an existing email or hashed email but it doesn't match what was passed in, warn the customer
78
88
if emailMismatch {
79
-
print("The existing email on the user (\(userEmailIdentity ??"nil")) does not match the email passed in to `selectPlacements:` (\(email ??"nil")). Please remember to sync the email identity to mParticle as soon as you receive it. We will now identify the user before creating the layout")
89
+
MPLog.warning("The existing email on the user (\(userEmailIdentity ??"nil")) does not match the email passed in to `selectPlacements:` (\(email ??"nil")). Please remember to sync the email identity to mParticle as soon as you receive it. We will now identify the user before creating the layout")
80
90
}
81
91
if hashedEmailMismatch {
82
-
print("The existing hashed email on the user (\(user.identities[hashedEmailIdentity ??NSNumber(value:-1)]??"nil")) does not match the email passed in to `selectPlacements:` (\(hashedEmail ??"nil")). Please remember to sync the hashed email identity to mParticle as soon as you receive it. We will now identify the user before creating the layout")
92
+
MPLog.warning("The existing hashed email on the user (\(user.identities[hashedEmailIdentity ??NSNumber(value:-1)]??"nil")) does not match the email passed in to `selectPlacements:` (\(hashedEmail ??"nil")). Please remember to sync the hashed email identity to mParticle as soon as you receive it. We will now identify the user before creating the layout")
0 commit comments