Spike: Investigate the Sync API to establish how to use the conditions specified in the Sync microsurvey requirement
Categories
(Fenix :: Experimentation and Telemetry, task, P1)
Tracking
(Not tracked)
People
(Reporter: towhite, Assigned: towhite)
References
Details
Can/how to determine the following conditions using the Sync API:
- User has been signed into sync for 7+ days
- User is signed into a second device
User has been signed into sync for 7+ days
There are existing triggers called FXA_SIGNED_IN
and FXA_NOT_SIGNED_IN
that use the sync_auth.sign_in
metrics. This is set in BackgroundServices.kt. In this file we also use onAuthenticated
when a user signs in to set the following preference:
context.settings().signedInFxaAccount = true
andonLoggedOut
when a user logs out we set this value to false
context.settings().signedInFxaAccount = false
Therefore, using a combination of the signedInFxaAccount
preference & the sync_auth.sign_in
event the User has been signed into sync for 7+ days
condition can be determined.
Update
With trigger-if-all
& exclude-if-any
we can have an event where we count that we have seen a sign in in the last 7 and we haven't count sign out in the last 7 days. These events are SyncAuth.signIn
& SyncAuth.signOut
User is signed into a second device
FxaDeviceConstellation is used to Describes available interactions with the current device and other devices associated with an [OAuthAccount].
and accessed in Devices.kt
Also see Jeff's comment below.
Comment 3•7 months ago
|
||
We access all of the devices a user has hooked up to sync here: https://searchfox.org/mozilla-central/source/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/share/ShareViewModel.kt with the most relevant bits: https://searchfox.org/mozilla-central/rev/dd421ae14997e3bebb9c08634633a4a3e3edeffc/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/share/ShareViewModel.kt#201
Hope this helps!
Description
•