Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
527 commits
Select commit Hold shift + click to select a range
e0fa9be
PBI-5122 encryption support (#569)
PoornimaApptentive Aug 11, 2023
3f2a258
PBI-5555 Rename roster and cleanup (#571)
PoornimaApptentive Aug 16, 2023
a72e8c7
PBI-5055 JWT sub extract (#572)
ChaseApptentive Aug 17, 2023
a3b70eb
remove legacyPending and nextText (#573)
PoornimaApptentive Aug 17, 2023
83420a6
PBI-5572 Delete old conversation file (#574)
PoornimaApptentive Aug 22, 2023
d661e06
Add manifest structure change tests (#575)
ChaseApptentive Aug 25, 2023
0500758
PBI-4007, PBI-4008 (#576)
PoornimaApptentive Aug 30, 2023
665cdad
Update distribution name and version from configuration
frankus Aug 31, 2023
bd4af17
Simply distribution/version diffing
frankus Aug 31, 2023
f2f8cf5
Further simply SDK diffing
frankus Aug 31, 2023
c1a628e
Better log statement
frankus Aug 31, 2023
ebec997
More logging tweaks
frankus Aug 31, 2023
6d7cd15
Merge pull request #577 from apptentive/PBI-5634
frankus Aug 31, 2023
d5736c8
PBI-5628 State machine (#580)
PoornimaApptentive Sep 11, 2023
592732c
Rename 'sendPayload' to 'enqueuePayload' (when queueing for sending)
frankus Sep 19, 2023
5415602
login with state machine changes
Sep 19, 2023
e55f695
Merge pull request #581 from apptentive/refactor/payload-send-queue
frankus Sep 19, 2023
04935d6
login with state machine changes (#582)
PoornimaApptentive Sep 20, 2023
f7b767f
Merge branch 'feature/multi-user-authentication' into PBI-4007-login
Sep 21, 2023
5426ab5
update conversation id and token for message manager and conversation…
Sep 21, 2023
e0fac15
PBI-4007 login - Part 2 (#584)
PoornimaApptentive Sep 22, 2023
1e55073
Merge branch 'feature/multi-user-authentication' into PBI-5684-creden…
Sep 22, 2023
fcb7a12
login with state machine changes
Sep 19, 2023
3ccd9a2
Move conversation ID, token into PayloadData
frankus Sep 21, 2023
419b68a
Fix linter errors
frankus Sep 21, 2023
cb69cc8
Fix unit tests
frankus Sep 21, 2023
5777091
Fix failing tests
frankus Sep 21, 2023
cd79599
Prep for credentials provider
frankus Sep 21, 2023
274a1c3
Remove unused imports, stray comma
frankus Sep 21, 2023
9a11b5c
Add a couple of FIXMEs
frankus Sep 21, 2023
a24f105
sync with upstream
frankus Sep 22, 2023
e03e13f
remove conversation id & token from the conversation service & messag…
Sep 22, 2023
67df6ec
rename
Sep 22, 2023
c1f9266
test fixes & lint format
Sep 22, 2023
5be04bb
Merge remote-tracking branch 'origin/PBI-5684-credentials-provider' i…
frankus Sep 22, 2023
8597e7e
Merge with ConversationCredentialProvider code
frankus Sep 22, 2023
2576436
Fix ignored test
frankus Sep 22, 2023
db7face
fix linter error
frankus Sep 22, 2023
dd04d34
PBI-5684 credentials provider (#585)
PoornimaApptentive Sep 22, 2023
4004b20
Merge branch 'feature/multi-user-authentication' into feature/payload…
frankus Sep 22, 2023
b331929
Standardize pluralization of conversationCredential
frankus Sep 22, 2023
b5cdb3c
Merge pull request #583 from apptentive/feature/payload-token-convid
frankus Sep 22, 2023
698fd5a
save conversation changes after login occurs, register provider at th…
PoornimaApptentive Sep 25, 2023
00d45d0
PBI-2901 Store encryption key in Android key store (#588)
PoornimaApptentive Oct 3, 2023
c8b28b5
Fix tests
frankus Oct 4, 2023
75400c3
WIP
frankus Oct 5, 2023
cff6d2a
Tests passing
frankus Oct 6, 2023
5062e12
PBI-5699 Replace JWT with conversation token (#589)
PoornimaApptentive Oct 6, 2023
0668226
PBI-5556 Fix ignored serializer tests (#591)
PoornimaApptentive Oct 6, 2023
4efdbf7
Fix tests
frankus Oct 6, 2023
5df90a4
Merge branch 'feature/multi-user-authentication' into PBI-4005
frankus Oct 6, 2023
392f74e
Delete message file as soon as encryption settings change detected (#…
PoornimaApptentive Oct 13, 2023
e8a1815
PBI-5054 Push provider setup for multi user (#594)
PoornimaApptentive Oct 13, 2023
3ace2ca
change http to https in terms and conditions
LuqKhan Oct 16, 2023
8aee479
migrate logged in and logged out conversations
Oct 19, 2023
1a0b900
update conversation file path after migrating the logged out conversa…
Oct 23, 2023
d4ceeeb
cleanup done TODOs
Oct 23, 2023
4e37b83
update convertToLink to handle http being passed
LuqKhan Oct 23, 2023
a7d93a1
reset to sonatype version
Oct 23, 2023
2efee99
WIP
frankus Oct 24, 2023
4465467
Merge branch 'feature/multi-user-authentication' into PBI-4005
frankus Oct 24, 2023
848eb21
Use empty conversation with provided ID and token when migration and …
Oct 24, 2023
01fde9c
remove elf is null
LuqKhan Oct 24, 2023
096e5ab
formatting
LuqKhan Oct 24, 2023
383d95d
make convertToLink concise and formatted
LuqKhan Oct 24, 2023
5abb869
Merge pull request #595 from apptentive/PBI-5704
LuqKhan Oct 24, 2023
25ff9db
Merge branch 'PBI-5059-migration' into PBI-4005
frankus Oct 25, 2023
fdce98b
PBI-5059 Migrate logged in and logged out conversations (#596)
PoornimaApptentive Oct 25, 2023
5f02913
WIP
frankus Oct 25, 2023
2faada5
logout event and delete session
Oct 25, 2023
58ef4c8
lint format
Oct 26, 2023
e8a91d3
WIP
frankus Oct 26, 2023
54c6366
WIP
frankus Oct 27, 2023
44fdbea
WIP
frankus Oct 31, 2023
c6d3881
WIP
frankus Nov 1, 2023
4f06de5
WIP
frankus Nov 1, 2023
51e4481
Add tests for payload-encrypted messages and messages with attachments
frankus Nov 1, 2023
1b8673b
Ensure content not empty for attachment parts
frankus Nov 1, 2023
2dbe2c7
Don't encrypt already-encrypted payload data for storage
frankus Nov 1, 2023
b34ce6f
Remove debugging code
frankus Nov 1, 2023
722dc43
Cleanup
frankus Nov 1, 2023
671ce1c
Autoformat
frankus Nov 1, 2023
569650e
Remove more debugging code
frankus Nov 1, 2023
78f395a
Revert jfrog version
frankus Nov 1, 2023
c887cc6
Merge branch 'feature/multi-user-authentication' into PBI-4005-2
frankus Nov 1, 2023
a53bb1f
Fix test warnings
frankus Nov 2, 2023
d8a5919
Merge branch 'PBI-4005-2' of https://github.com/apptentive/apptentive…
frankus Nov 2, 2023
3e7d0af
Fix linter errors
frankus Nov 2, 2023
b20c969
Merge remote-tracking branch 'origin/PBI-4001-logout' into PBI-4005-2
frankus Nov 2, 2023
6fcd939
Update logout payload for encrypted payload code
frankus Nov 2, 2023
a474e8b
Remove debug log statement
frankus Nov 2, 2023
f65f0bd
PBI-4001 Delete session on logout (#598)
PoornimaApptentive Nov 2, 2023
d88b598
First round of PR review fixes
frankus Nov 2, 2023
4a7cea7
Remove extraneous TODO
frankus Nov 2, 2023
99887ca
Refactor payloads a bit
frankus Nov 2, 2023
1897e7f
Split PayloadPart implementations into their own files, mark things i…
frankus Nov 2, 2023
deac584
Cleanup and PR comment resolutions
frankus Nov 2, 2023
9759c66
Don't try not to double-encrypt authenticated payloads
frankus Nov 3, 2023
87b323b
Clarify logic of converting to encrypted payload data
frankus Nov 3, 2023
31179be
Expanded comments for getContentType and getDataBytes
frankus Nov 3, 2023
3bb0a14
Merge branch 'feature/multi-user-authentication' into PBI-4005-2
frankus Nov 3, 2023
68b34d6
Simplify variables for payload parts
frankus Nov 3, 2023
10c11c6
Merge branch 'PBI-4005-2' of https://github.com/apptentive/apptentive…
frankus Nov 3, 2023
8aaec6b
Linter fixes
frankus Nov 3, 2023
17fe3f1
Remove test that only succeeds in UTC-7 time zone
frankus Nov 3, 2023
5bee9b5
Merge pull request #601 from apptentive/PBI-4005-2
frankus Nov 3, 2023
699ab60
set the manifest expiry before sending the logout event (#603)
PoornimaApptentive Nov 3, 2023
ee9536c
PBI-4010 MU support for internal test app (#602)
PoornimaApptentive Nov 3, 2023
4f5f777
Use customer-supplied JWT (not API-supplied JWT) in updateConversatio…
frankus Nov 6, 2023
8a1560d
PBI-5820 Decryption failure while printing payloads (#606)
PoornimaApptentive Nov 7, 2023
06ebd2b
add update token and authfailure callback to internal test app (#607)
PoornimaApptentive Nov 7, 2023
9856a0d
set jwt as conversation token for anonymous-login user (#608)
PoornimaApptentive Nov 7, 2023
4cdebaa
Add method to update token
frankus Nov 8, 2023
fd7599e
Merge branch 'feature/multi-user-authentication' of https://github.co…
frankus Nov 8, 2023
601c29c
Fix redundant payload type lowercasing
frankus Nov 8, 2023
510e7de
Rename to EncryptedPayloadTokenUpdater
frankus Nov 8, 2023
c9d28b0
Use ConversationCredential*Provider*
frankus Nov 8, 2023
1fd1597
Linter fixes
frankus Nov 8, 2023
94227fa
PBI-5831 Update session and send launch events for new logins (#610)
PoornimaApptentive Nov 8, 2023
2fd9e57
merging develop
Nov 8, 2023
9f827b9
Add tests for update method in SQLite helper
frankus Nov 9, 2023
22c9e74
Fix some failing tests
frankus Nov 9, 2023
491e3a5
Add isRegistered and invoke callback for register
Nov 9, 2023
a5d5cf5
fix todos/create tickets (#611)
PoornimaApptentive Nov 9, 2023
c0e1409
Add isRegistered and invoke callback for register (#612)
PoornimaApptentive Nov 9, 2023
55b4a6f
WIP
frankus Nov 9, 2023
e2f7a5b
Merge branch 'feature/multi-user-authentication' of https://github.co…
frankus Nov 9, 2023
811419b
Fix JSON number mangling
frankus Nov 9, 2023
89dfbcc
reset last known message & refetch message (#613)
PoornimaApptentive Nov 9, 2023
598171b
Fix some tests
frankus Nov 9, 2023
74aba39
Mock session ID generation
frankus Nov 9, 2023
7bbb0a9
Streamline token update, print payload queue sensibly
frankus Nov 9, 2023
d980a0e
Remove debug mod
frankus Nov 9, 2023
fe09664
Move sesion ID rule to correct package
frankus Nov 9, 2023
927aa19
Revert tests, ingore bad session ID
frankus Nov 9, 2023
8095800
Print embedded token column as such
frankus Nov 9, 2023
1659086
Add a number of comments
frankus Nov 9, 2023
e352d78
Autoformat
frankus Nov 9, 2023
0bb295c
Cleanup from PR review
frankus Nov 9, 2023
8e01f59
Removed whitespace diff
frankus Nov 9, 2023
462cd04
Just drop the table if changing DB versions
frankus Nov 9, 2023
a70ac33
PBI-5819 refetch messages (#614)
PoornimaApptentive Nov 9, 2023
43c922f
Increase max data size to print for payload queue printer
frankus Nov 10, 2023
8c68784
Merge pull request #609 from apptentive/feature/PBI-5056-update-paylo…
frankus Nov 10, 2023
ca9ad33
Update android.yml
PoornimaApptentive Nov 10, 2023
110a09e
Update ApptentiveDefaultClient.kt
PoornimaApptentive Nov 10, 2023
892cab5
Merge pull request #615 from apptentive/feature/multi-user-authentica…
PoornimaApptentive Nov 10, 2023
a946892
possible fix
Nov 13, 2023
cf70708
Merge pull request #616 from apptentive/migration-fix-1
PoornimaApptentive Nov 13, 2023
197f444
PBI-5838 Prep for release (#617)
PoornimaApptentive Nov 14, 2023
6319d0f
hide sensitive data, clear log confusion around logging when launched…
PoornimaApptentive Nov 29, 2023
7c0083e
cleanup update token method (#618)
PoornimaApptentive Nov 29, 2023
62831d4
PBI-5770 Update play libraries (#621)
PoornimaApptentive Dec 6, 2023
97fc4a1
PBI-5919 Version changes & changelog (#622)
PoornimaApptentive Dec 7, 2023
93ec932
PBI-5840 Throttle roster (#623)
PoornimaApptentive Dec 11, 2023
cf20c28
PBI-5863 Add max number of attempt for update token in a session (#624)
PoornimaApptentive Dec 11, 2023
44849e1
PBI-5864 Delete migrated legacy files (#625)
PoornimaApptentive Dec 13, 2023
da12ca7
clean payloadsender initialization in ApptentiveClient and remove unu…
PoornimaApptentive Dec 15, 2023
9781c35
Account for encryption exception when throtting roster so if the back…
PoornimaApptentive Dec 19, 2023
44fc548
feature branch checks
Jan 3, 2024
789322e
PBI-6007 Prefetch images, store and retrieve (#629)
PoornimaApptentive Jan 5, 2024
014397a
PBI-5966, PBI-5969 Update UI viewmodel to support images in prompts (…
PoornimaApptentive Jan 11, 2024
41a4263
PBI-5973 Prompts max height & button panel (#631)
PoornimaApptentive Jan 19, 2024
caf553f
[PBI-5988] [PBI-5982][PBI-5975][PBI-5977][PBI-5980] Support image pos…
PoornimaApptentive Jan 25, 2024
156c0a7
image alignment fixes (#633)
PoornimaApptentive Jan 26, 2024
6e58799
[PBI-5980] [PBI-5977] Rotation issue (#634)
PoornimaApptentive Jan 30, 2024
bf64b1b
PBI-6205 full width position (#635)
PoornimaApptentive Feb 6, 2024
4df19c0
PBI-5971 Alternate text view (#636)
PoornimaApptentive Feb 6, 2024
1d59f8e
Adjust align left and align right better to fit the image density (#637)
PoornimaApptentive Feb 13, 2024
15fcace
PBI-6222 missing required field (#638)
PoornimaApptentive Feb 15, 2024
4a017c7
fix space under the button, fix the layout for rich vs old style prom…
PoornimaApptentive Feb 15, 2024
8d16119
setting touchmode focus to all the elements (#640)
PoornimaApptentive Feb 23, 2024
bc03586
PBI-6276 extraspace (#642)
PoornimaApptentive Mar 1, 2024
b6abbee
PBI-6290 prefetch url (#643)
PoornimaApptentive Mar 6, 2024
e28ef60
PBI-6312 prompts layouts (#644)
PoornimaApptentive Mar 18, 2024
c9046a1
PBI-6314 single line button (#646)
PoornimaApptentive Mar 20, 2024
fe0af27
Revert maxLines check for prompts button
PoornimaApptentive Mar 20, 2024
425c36c
update yml to run checks on feature branch
Mar 22, 2024
f319f90
[PBI-6349] Release PR (#649)
PoornimaApptentive Mar 25, 2024
1bdd8de
Merge branch 'develop' into PBI-6074-rich-content-text
Mar 26, 2024
341905d
support links and html styles (#648)
PoornimaApptentive Mar 26, 2024
355dd3d
PBI-6401 Survey rich content support (#650)
PoornimaApptentive Apr 3, 2024
4bde199
PBI-6401 survey styling (#651)
PoornimaApptentive Apr 4, 2024
efd6eed
PBI-6440 survey link (#652)
PoornimaApptentive Apr 5, 2024
35f5f68
Merge pull request #653 from apptentive/PBI-6074-rich-content-text
PoornimaApptentive Apr 7, 2024
6d33cdd
ungroup the question layout so it is voiced out properly with html el…
Apr 8, 2024
0ce4144
Merge pull request #654 from apptentive/PBI-6445-survey-question-acce…
PoornimaApptentive Apr 9, 2024
bc989f3
Release update
Apr 12, 2024
a6ad144
update changelog
Apr 24, 2024
bd1b57e
Merge pull request #655 from apptentive/release-6.7
PoornimaApptentive Apr 24, 2024
1c4ef1b
add feature branch check
May 1, 2024
ddc615e
fields to support ACR
May 2, 2024
52b4a34
Merge pull request #656 from apptentive/PBI-6427-update-navigatotlink…
PoornimaApptentive May 3, 2024
d76d1a8
Add support for in-app-review view
May 6, 2024
e0eb0e1
Merge branch 'PBI-6453-Advanced-Customer-Research' into PBI-6429-new-…
May 6, 2024
d010f10
change the event name to new
May 6, 2024
6e82382
support local customization
May 7, 2024
8088914
cleanup
May 7, 2024
a6b1106
Merge pull request #657 from apptentive/PBI-6429-new-in-app-review-view
PoornimaApptentive May 8, 2024
4ed9d70
call launch events for both self and new target and close button fix
May 8, 2024
5f0d463
add missing files to commit
May 8, 2024
7aa713f
lint
May 8, 2024
63f087c
clean up append_variables
May 10, 2024
efc1e38
test fix
May 10, 2024
416975d
Merge pull request #658 from apptentive/PBI-6433-navigate-link
PoornimaApptentive May 10, 2024
d7b26c8
Merge pull request #659 from apptentive/PBI-6453-Advanced-Customer-Re…
PoornimaApptentive May 15, 2024
48043b6
enable javascript
LuqKhan May 22, 2024
9c636f5
formatting
LuqKhan May 28, 2024
d188a47
Merge pull request #661 from apptentive/PBI-6778
LuqKhan May 28, 2024
4abd4ec
PBI-6783 Webview state fix (#662)
PoornimaApptentive May 28, 2024
5bb373b
Preparing release 6.8.0 (#664)
PoornimaApptentive May 29, 2024
2beb3c1
remove jfrog (#666)
PoornimaApptentive Jun 28, 2024
eceac86
PBI-6080 MessageCenter input fields gets reset after attaching file (…
LuqKhan Jul 11, 2024
d86eae3
bump the targetSDK to 34 and cleanup the deprecated usages (#668)
PoornimaApptentive Jul 12, 2024
be48810
Add support to webview to play videos (#669)
PoornimaApptentive Jul 15, 2024
8e493af
[PBI-7016] Implement onShowFileChoser to launch the intent with FileC…
PoornimaApptentive Jul 16, 2024
6f0e2b9
PBI-7048 Save name/email when MC is exited and repopulate fields. (#671)
LuqKhan Jul 18, 2024
709add1
PBI-5097 Pause the SDKs if the providers are empty (#672)
PoornimaApptentive Jul 22, 2024
073092c
display survey title on the activity app bar (#673)
PoornimaApptentive Jul 23, 2024
2ef138b
PBI-7081 Load alchemer survey in browser for the apps using API below…
PoornimaApptentive Jul 23, 2024
e314266
PBI-7086 bump gradle compile sdk (#675)
PoornimaApptentive Jul 24, 2024
55a7ff0
PBI-709 6.8.1 release prep (#676)
PoornimaApptentive Jul 30, 2024
12a75f2
[PBI-6965] Digital initiator (#686)
PoornimaApptentive Sep 10, 2024
6ec322a
PBI-6997 Change log for 6.9 (#687)
PoornimaApptentive Sep 19, 2024
f1a59d1
[PBI-7097] Device update (#688)
PoornimaApptentive Sep 20, 2024
6cb94d5
replace onBackPressed with onBackPressedDispatcher callback (#692)
PoornimaApptentive Oct 29, 2024
583537c
enable safe usage of websettings (#693)
PoornimaApptentive Oct 31, 2024
d8bf07d
release prep (#695)
PoornimaApptentive Nov 13, 2024
8d684db
changelog (#696)
PoornimaApptentive Nov 21, 2024
dc2c2bd
PBI-4322 Textviews shouldn't be selectable if there are no link using…
PoornimaApptentive Dec 17, 2024
6cbb264
[PBI-5853] Look for old conversation storage file with the exact file…
PoornimaApptentive Jan 24, 2025
900331d
PBI-7084 Use system dark mode (#702)
PoornimaApptentive Jan 24, 2025
b3e3a30
[PBI-4323] manually give a11y focus when the edit text comes visible …
PoornimaApptentive Jan 24, 2025
8f1261c
[PBI-7768][PBI-7767][PBI-7769] Non focusable items on survey shouldn'…
PoornimaApptentive Jan 27, 2025
70ffe8a
[PBI-4323] Other option a11y (#708)
PoornimaApptentive Feb 5, 2025
c848260
[PBI-6441] Support FlutterActivity (#713)
PoornimaApptentive Feb 27, 2025
de43b99
[PBI-7901] Applied kotlin jvm via toolchain config (#714)
PoornimaApptentive Feb 28, 2025
ab67753
change log and kit configuration (#715)
PoornimaApptentive Mar 5, 2025
d25ede2
[PBI-7951][PBI-7953][PBI-7964]retry interaction launchers once if the…
PoornimaApptentive Mar 14, 2025
14a0dbc
6.9.3 release updates (#721)
PoornimaApptentive Mar 25, 2025
cb58ed2
Add metricsEnabled to configuration
Apr 2, 2025
21f555b
Use Configuration object instead ApptentiveConfiguration for metrics …
Apr 4, 2025
16405e5
the app is using v6.9.1
Apr 18, 2025
daacb71
Use 6.9.32 jfrog build with fix
Apr 18, 2025
0c3c7fe
use the current sdk modules
Apr 18, 2025
3e8c5d9
commit for public branch
Apr 18, 2025
fcc2b5b
conclude merge
Apr 18, 2025
e02a4e3
Update build.gradle
PoornimaApptentive Apr 23, 2025
b55e4d8
missing sharedpref constant
May 12, 2025
583b134
lint and comment signing
May 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ object SharedPrefConstants {
const val CRYPTO_ENABLED = "should_encrypt"
const val CRYPTO_KEY_ALIAS = "crypto.key.alias"
const val CRYPTO_KEY_WRAPPER_ALIAS = "_crypto.key.wrapper.alias" // to store wrapper key of multi-user encryption key
const val METRICS_ENABLED = "metrics_enabled"
}
Original file line number Diff line number Diff line change
Expand Up @@ -698,16 +698,23 @@ class ApptentiveDefaultClient(
// store event locally
conversationManager.recordEvent(event)

// send event to the backend
enqueuePayload(
EventPayload(
label = event.fullName,
interactionId = interactionId,
data = data,
customData = customData,
extendedData = extendedData
val metricsConfiguration = conversationManager.getConversation().configuration

if (metricsConfiguration.metricsEnabled || event.vendor == "com.apptentive" || BuildConfig.DEBUG) {
Log.d(EVENT, "Recording event: ${event.fullName}")
// send event to the backend
enqueuePayload(
EventPayload(
label = event.fullName,
interactionId = interactionId,
data = data,
customData = customData,
extendedData = extendedData
)
)
)
} else {
Log.v(EVENT, "Metrics are disabled. Not sending event: ${event.fullName}")
}
}

override fun setLocalManifest(json: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -178,7 +179,12 @@ internal class ConversationManager(
val existingConversation = loadExistingConversation()
if (existingConversation != null) {
Log.i(CONVERSATION, "Loaded an existing conversation")

Copy link
Copy Markdown
Collaborator Author

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.

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()
Expand Down Expand Up @@ -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)) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The 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
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@ import apptentive.com.android.util.InternalUseOnly
* Data container class for Apptentive configuration.
*
* @param expiry - Length of time before Configuration expires and should re-fetch from server
*
* @param messageCenter - Configuration for Message Center
*
* @param metricsEnabled - Determines if the Apptentive SDK should collect metrics.
*
* If `true`, the SDK will collect metrics and send them to the Apptentive API.
*
* If `false`, the SDK will collect metrics to user internally. It won't send them to the Apptentive API.
*/
@InternalUseOnly
data class Configuration(
var expiry: TimeInterval = 0.0,
val messageCenter: MessageCenter = MessageCenter()
val messageCenter: MessageCenter = MessageCenter(),
val metricsEnabled: Boolean = true,
) {
/**
* Data container class for Apptentive Message Center configuration.
Expand Down
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -83,6 +83,9 @@ buildscript {
repositories {
google()
mavenCentral()
maven {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The 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()) {
Expand Down
6 changes: 3 additions & 3 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ publishing {
}
}

signing {
sign publishing.publications
}
//signing {
// sign publishing.publications
//}

artifactory {
contextUrl = 'https://apptentive.jfrog.io/artifactory'
Expand Down