Skip to content

Commit 1369945

Browse files
committed
Merge remote-tracking branch 'remotes/origin/master' into feat/rename-presonalizatio-module
2 parents 67bd04b + 4d3391f commit 1369945

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

personalization-sdk/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
id 'kotlin-kapt'
77
}
88

9-
version='2.0.16'
9+
version='2.0.17'
1010

1111
android {
1212
compileSdkVersion 34

personalization-sdk/src/main/kotlin/com/personalization/RegisterManager.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class RegisterManager @Inject constructor(
5050
this.contentResolver = contentResolver
5151
this.autoSendPushToken = autoSendPushToken
5252

53-
if (did != null) return
53+
if (!did.isNullOrEmpty()) return
5454

5555
did = getPreferencesValueUseCase.getDid()
5656

@@ -84,11 +84,11 @@ class RegisterManager @Inject constructor(
8484

8585
val currentDate = Date()
8686

87-
if (tokenField.isEmpty()
87+
if(autoSendPushToken &&
88+
(tokenField.isEmpty()
8889
|| tokenField != token
89-
|| (currentDate.time - getPreferencesValueUseCase.getLastPushTokenDate()) >= ONE_WEEK_MILLISECONDS
90+
|| (currentDate.time - getPreferencesValueUseCase.getLastPushTokenDate()) >= ONE_WEEK_MILLISECONDS)
9091
) {
91-
9292
setPushTokenNotification(token, object : OnApiCallbackListener() {
9393
override fun onSuccess(response: JSONObject?) {
9494
savePreferencesValueUseCase.saveLastPushTokenDate(currentDate.time)
@@ -164,11 +164,11 @@ class RegisterManager @Inject constructor(
164164
//To do this, it is enough to track the time of the last action for the session and, if it is more than N hours, then create a new session.
165165

166166
if (seance == null) {
167-
val sid = getPreferencesValueUseCase.getSid()
168-
if(sid.isEmpty()
167+
val newSid = getPreferencesValueUseCase.getSid()
168+
if(newSid.isNotEmpty()
169169
&& getPreferencesValueUseCase.getSidLastActTime() >= System.currentTimeMillis() - SESSION_CODE_EXPIRE * 3600 * 1000)
170170
{
171-
seance = sid
171+
seance = newSid
172172
}
173173
}
174174

0 commit comments

Comments
 (0)