-
Notifications
You must be signed in to change notification settings - Fork 7
Livesport metrics config updated #43
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
base: main
Are you sure you want to change the base?
Changes from all commits
e0fa9be
3f2a258
a72e8c7
a3b70eb
83420a6
d661e06
0500758
665cdad
bd4af17
f2f8cf5
c1a628e
ebec997
6d7cd15
d5736c8
592732c
5415602
e55f695
04935d6
f7b767f
5426ab5
e0fac15
1e55073
fcb7a12
3ccd9a2
419b68a
cb69cc8
5777091
cd79599
274a1c3
9a11b5c
a24f105
e03e13f
67df6ec
c1f9266
5be04bb
8597e7e
2576436
db7face
dd04d34
4004b20
b331929
b5cdb3c
698fd5a
00d45d0
c8b28b5
75400c3
cff6d2a
5062e12
0668226
4efdbf7
5df90a4
392f74e
e8a1815
3ace2ca
8aee479
1a0b900
d4ceeeb
4e37b83
a7d93a1
2efee99
4465467
848eb21
01fde9c
096e5ab
383d95d
5abb869
25ff9db
fdce98b
5f02913
2faada5
58ef4c8
e8a91d3
54c6366
44fdbea
c6d3881
4f06de5
51e4481
1b8673b
2dbe2c7
b34ce6f
722dc43
671ce1c
569650e
78f395a
c887cc6
a53bb1f
d8a5919
3e7d0af
b20c969
6fcd939
a474e8b
f65f0bd
d88b598
4a7cea7
99887ca
1897e7f
deac584
9759c66
87b323b
31179be
3bb0a14
68b34d6
10c11c6
8aaec6b
17fe3f1
5bee9b5
699ab60
ee9536c
4f5f777
8a1560d
06ebd2b
9856a0d
4cdebaa
fd7599e
601c29c
510e7de
c9d28b0
1fd1597
94227fa
2fd9e57
9f827b9
22c9e74
491e3a5
a5d5cf5
c0e1409
55b4a6f
e2f7a5b
811419b
89dfbcc
598171b
74aba39
7bbb0a9
d980a0e
fe09664
927aa19
8095800
1659086
e352d78
0bb295c
8e01f59
462cd04
a70ac33
43c922f
8c68784
ca9ad33
110a09e
892cab5
a946892
cf70708
197f444
6319d0f
7c0083e
62831d4
97fc4a1
93ec932
cf20c28
44849e1
da12ca7
9781c35
44fc548
789322e
014397a
41a4263
caf553f
156c0a7
6e58799
bf64b1b
4df19c0
1d59f8e
15fcace
4a017c7
8d16119
bc03586
b6abbee
e28ef60
c9046a1
fe0af27
425c36c
f319f90
1bdd8de
341905d
355dd3d
4bde199
efd6eed
35f5f68
6d33cdd
0ce4144
bc989f3
a6ad144
bd1b57e
1c4ef1b
ddc615e
52b4a34
d76d1a8
e0eb0e1
d010f10
6e82382
8088914
a6b1106
4ed9d70
5f0d463
7aa713f
63f087c
efc1e38
416975d
d7b26c8
48043b6
9c636f5
d188a47
4abd4ec
5bb373b
2beb3c1
eceac86
d86eae3
be48810
8e493af
6f0e2b9
709add1
073092c
2ef138b
e314266
55a7ff0
12a75f2
6ec322a
f1a59d1
6cb94d5
583537c
d8bf07d
8d684db
dc2c2bd
6cbb264
900331d
b3e3a30
8f1261c
70ffe8a
c848260
de43b99
ab67753
d25ede2
14a0dbc
cb58ed2
21f555b
16405e5
daacb71
0c3c7fe
3e8c5d9
fcc2b5b
e02a4e3
b55e4d8
583b134
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 |
|---|---|---|
|
|
@@ -45,6 +45,7 @@ import apptentive.com.android.feedback.utils.isMarshmallowOrGreater | |
| import apptentive.com.android.feedback.utils.toSecretKeyBytes | ||
| import apptentive.com.android.network.UnexpectedResponseException | ||
| import apptentive.com.android.platform.AndroidSharedPrefDataStore | ||
| import apptentive.com.android.platform.SharedPrefConstants.METRICS_ENABLED | ||
| import apptentive.com.android.platform.SharedPrefConstants.SDK_CORE_INFO | ||
| import apptentive.com.android.platform.SharedPrefConstants.SDK_VERSION | ||
| import apptentive.com.android.serialization.json.JsonConverter | ||
|
|
@@ -178,7 +179,12 @@ internal class ConversationManager( | |
| val existingConversation = loadExistingConversation() | ||
| if (existingConversation != null) { | ||
| Log.i(CONVERSATION, "Loaded an existing conversation") | ||
| return existingConversation | ||
| return existingConversation.copy( | ||
| configuration = existingConversation.configuration.copy( | ||
| metricsEnabled = DependencyProvider.of<AndroidSharedPrefDataStore>() | ||
| .getBoolean(SDK_CORE_INFO, METRICS_ENABLED, existingConversation.configuration.metricsEnabled) | ||
| ) | ||
| ) | ||
| } | ||
|
|
||
| val legacyConversation = tryMigrateLegacyConversation() | ||
|
|
@@ -507,7 +513,7 @@ internal class ConversationManager( | |
| val conversation = activeConversationSubject.value | ||
| val configuration = conversation.configuration | ||
|
|
||
| if (isInThePast(configuration.expiry) || isDebuggable) { | ||
| if (isInThePast(configuration.expiry) || isDebuggable || !DependencyProvider.of<AndroidSharedPrefDataStore>().containsKey(SDK_CORE_INFO, METRICS_ENABLED)) { | ||
|
Collaborator
Author
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. I had to add this check to ensure the Configuration is fetched if the metrics value is not found the shared pref which means the app is launched for the first time after enabling the metrics value. |
||
| Log.d(CONVERSATION, "Fetching configuration") | ||
| val token = conversation.conversationToken | ||
| val id = conversation.conversationId | ||
|
|
@@ -523,6 +529,8 @@ internal class ConversationManager( | |
| activeConversationSubject.value = activeConversationSubject.value.copy( | ||
| configuration = it.data | ||
| ) | ||
| DependencyProvider.of<AndroidSharedPrefDataStore>() | ||
| .putBoolean(SDK_CORE_INFO, METRICS_ENABLED, it.data.metricsEnabled) | ||
| } | ||
| is Result.Error -> { | ||
| Log.e(CONVERSATION, "Error while fetching configuration", it.error) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,8 +67,8 @@ buildscript { | |
| } | ||
|
|
||
| project.ext { | ||
| sonatypeVersion = '6.9.3' | ||
| jfrogVersion = '6.8.1' | ||
| sonatypeVersion = '6.9.4' | ||
| jfrogVersion = '6.9.4' | ||
|
|
||
| // Change this depending on where you are publishing to | ||
| repoVersion = sonatypeVersion | ||
|
|
@@ -83,6 +83,9 @@ buildscript { | |
| repositories { | ||
| google() | ||
| mavenCentral() | ||
| maven { | ||
|
Collaborator
Author
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. Not relevant with the fix. But I need it if we are going to share the jfrog repo. |
||
| url "https://apptentive.jfrog.io/artifactory/NewAndroidSDK" | ||
| } | ||
| maven { | ||
| def artifactoryProperties = new Properties() | ||
| if (project.rootProject.file('local.properties').exists()) { | ||
|
|
||
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.
Android fetches configuration after manifest expiry and the value serialized will be used. However, I cannot serialize metrics value as part of the configuration as it would break the entire serialization. Hence, using the shared pref to use it in between the launches.