Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public class FirebaseRemoteConfigProvider

  1. Object
  2. FirebaseRemoteConfigProvider

ImplementsRemoteConfigProvider

A RemoteConfigProvider for Firebase Remote Config, over the same REST endpoints the Firebase web SDK uses. No native SDK, Gradle dependency or pod is involved.

The provider registers a Firebase installation once and keeps its ID and token in Preferences. Each fetch then calls the namespaces/firebase:fetch endpoint. The project ID, Web API key and app ID come from the Firebase console (google-services.json holds all three).

Constructors

public FirebaseRemoteConfigProvider(String projectId, String apiKey, String appId)Creates a provider.

Methods

public void setTransport(CloudHttpTransport transport)Replaces the HTTP transport.
public void setBaseUrls(String installationsUrl, String configUrl)Points the provider at other hosts, for tests or a proxy.
public String getId()
public AsyncResource<Map<String, String>> fetch()Fetches the current values.

Inherited methods

Constructor details

FirebaseRemoteConfigProvider

public FirebaseRemoteConfigProvider(String projectId, String apiKey, String appId)
Creates a provider.

Parameters

projectId String
the Firebase project ID
apiKey String
the Web API key
appId String
the Firebase app ID, such as 1:1234:web:abcd

Method details

setTransport

public void setTransport(CloudHttpTransport transport)
Replaces the HTTP transport.

Parameters

transport CloudHttpTransport
the transport

setBaseUrls

public void setBaseUrls(String installationsUrl, String configUrl)
Points the provider at other hosts, for tests or a proxy.

Parameters

installationsUrl String
replaces https://firebaseinstallations.googleapis.com
configUrl String
replaces https://firebaseremoteconfig.googleapis.com

getId

public String getId()

Returns

a short stable ID that keeps this provider’s cache apart from others

fetch

public AsyncResource<Map<String, String>> fetch()
Fetches the current values.

Returns

a resource that completes with keys to string values