Skip to content
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

Fix/remote config minimum fetch interval #1591

Merged
merged 3 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="572" id="org.phidatalab.radar_armt" ios-CFBundleIdentifier="org.phidatalab.radar-armt" ios-CFBundleVersion="1" version="2.6.2-alpha" xmlns:android="http://schemas.android.com/apk/res/android">
<widget android-versionCode="573" id="org.phidatalab.radar_armt" ios-CFBundleIdentifier="org.phidatalab.radar-armt" ios-CFBundleVersion="1" version="2.6.3-alpha" xmlns:android="http://schemas.android.com/apk/res/android">
<name>RADAR Questionnaire</name>
<description>An application that collects active data for research.</description>
<author email="[email protected]" href="http://radar-base.org/">RADAR-Base</author>
Expand Down
3 changes: 2 additions & 1 deletion src/app/core/services/config/remote-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class FirebaseRemoteConfig implements RemoteConfig {
export class FirebaseRemoteConfigService extends RemoteConfigService {
private readonly configSubject: BehaviorSubject<RemoteConfig>
private FETCH_TIMEOUT_SECONDS = 20
private MINIMUM_FETCH_INTERVAL_SECONDS = 21600 // 6 hours

constructor(
private firebase: FirebaseX,
Expand All @@ -116,7 +117,7 @@ export class FirebaseRemoteConfigService extends RemoteConfigService {
super(storage)
this.configSubject = new BehaviorSubject(new EmptyRemoteConfig())
this.platform.ready().then(() => {
FirebasePlugin.setConfigSettings(this.FETCH_TIMEOUT_SECONDS, null)
FirebasePlugin.setConfigSettings(this.FETCH_TIMEOUT_SECONDS, this.MINIMUM_FETCH_INTERVAL_SECONDS)
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/assets/data/defaultConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Localisations } from './localisations'
export const DefaultPlatformInstance = 'RADAR-CNS'

// *Default app version
export const DefaultAppVersion = '2.6.1-alpha'
export const DefaultAppVersion = '2.6.3-alpha'

// *Default Android package name
export const DefaultPackageName = 'org.phidatalab.radar_armt'
Expand Down