-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MOB-10624] add anonymous user id to keychain #868
Changes from 2 commits
2ae35c8
3a0859f
3e16143
026a784
6ead82d
ce342d0
1e3e28d
f3d1bce
7e659d8
cc5eae9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,14 +155,12 @@ public static class Builder { | |
private IterableDataRegion dataRegion = IterableDataRegion.US; | ||
private boolean useInMemoryStorageForInApps = false; | ||
private IterableDecryptionFailureHandler decryptionFailureHandler; | ||
|
||
private boolean encryptionEnforced = false; | ||
private boolean enableAnonActivation = false; | ||
private boolean enableEmbeddedMessaging = false; | ||
private int eventThresholdLimit = 100; | ||
private IterableIdentityResolution identityResolution = new IterableIdentityResolution(); | ||
private IterableAnonUserHandler iterableAnonUserHandler; | ||
private IterableDecryptionFailureHandler decryptionFailureHandler; | ||
|
||
@NonNull | ||
public Builder setIterableAnonUserHandler(@NonNull IterableAnonUserHandler iterableAnonUserHandler) { | ||
|
@@ -357,6 +355,8 @@ public Builder setEnableEmbeddedMessaging(boolean enableEmbeddedMessaging) { | |
|
||
public Builder setIdentityResolution(IterableIdentityResolution identityResolution) { | ||
this.identityResolution = identityResolution; | ||
return this; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it necessary to return this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I am just following the other config values. It was deleted when resolving the merge conflicts for some reason. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. makes sense if other config values are also doing it |
||
} | ||
|
||
/** | ||
* Set a handler for decryption failures that can be used to handle data recovery | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,6 +154,16 @@ class IterableKeychainEncryptedDataMigrator( | |
IterableLogger.w(TAG, "No user ID found to migrate.") | ||
} | ||
|
||
// Fetch and migrate anonymous user ID | ||
val anonUserId = encryptedPrefs.getString(IterableKeychain.KEY_ANON_USER_ID, null) | ||
if (userId != null) { | ||
keychain.saveUserIdAnon(anonUserId) | ||
editor.remove(IterableKeychain.KEY_ANON_USER_ID) | ||
IterableLogger.d(TAG, "Anonymous User ID migrated: $anonUserId") | ||
} else { | ||
IterableLogger.w(TAG, "No anon user ID found to migrate.") | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since there was no KEY_ANON_USER_ID stored in encrypted shared prefs before we dont need to migrate it either. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm good point I will remove. |
||
// Fetch and migrate auth token | ||
val authToken = encryptedPrefs.getString(IterableKeychain.KEY_AUTH_TOKEN, null) | ||
if (authToken != null) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a duplicate. See line 157. I added two by accident in the merge conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right i didnt notice the one on top my bad
]