Updated on 2026-08-14

This commit is contained in:
Tangem 2026-05-20 11:27:43 -07:00
parent 5b516f2c9b
commit a82d8cdbba
43 changed files with 829 additions and 89 deletions

View file

@ -13,4 +13,19 @@ interface AppsFlyerStore {
suspend fun storeIfAbsent(value: AppsFlyerConversionData)
suspend fun storeUIDIfAbsent(value: String)
suspend fun getDeeplink(source: AppsFlyerDeeplinkSource): String?
suspend fun storeDeeplink(source: AppsFlyerDeeplinkSource, deeplink: String)
suspend fun clearDeeplink(source: AppsFlyerDeeplinkSource)
}
enum class AppsFlyerDeeplinkSource {
TangemPayHotWalletOnboarding,
;
fun toStoreKey() = when (this) {
TangemPayHotWalletOnboarding -> "tangem_pay_hot_wallet_onboarding"
}
}

View file

@ -56,8 +56,22 @@ internal class DefaultAppsFlyerStore(
}
}
private companion object {
override suspend fun getDeeplink(source: AppsFlyerDeeplinkSource): String? =
appPreferencesStore.getSyncOrNull(stringPreferencesKey(source.toStoreKey()))
override suspend fun storeDeeplink(source: AppsFlyerDeeplinkSource, deeplink: String) {
appPreferencesStore.editData { preferences ->
preferences[stringPreferencesKey(source.toStoreKey())] = deeplink
}
}
override suspend fun clearDeeplink(source: AppsFlyerDeeplinkSource) {
appPreferencesStore.editData { preferences ->
preferences.remove(stringPreferencesKey(source.toStoreKey()))
}
}
private companion object {
val UID_KEY = stringPreferencesKey("APPS_FLYER_UID")
val CONVERSION_DATA_KEY = stringPreferencesKey("APPS_FLYER_CONVERSION_DATA")
}