PushwooshFeatureFlags

Feature flags evaluated by Pushwoosh for this device and user.

Obtain it with Pushwoosh.getInstance().getFeatureFlags(); there is one instance per process, so it is safe to keep a reference. get reads the local cache only and never blocks on the network; the SDK refreshes the cache on app start, on return from background after 30 minutes, hourly while in foreground, after the first registration and after setUserId. Do not store personal data in flag properties.

Flags are requested at api/v2/device-api/. Behind a reverse proxy (setReverseProxy), that path is requested under the proxy root; a proxy URL that does not end with json/1.3/ means no flags are fetched at all. Without a proxy, a base URL that is missing or does not end with json/1.3/ means flags go to the canonical host of the application code the request carries.

Functions

Link copied to clipboard
Registers a listener for flag changes.
Link copied to clipboard
open fun get(key: String): FeatureFlag
Reads a flag from the local cache without touching the network.
Link copied to clipboard
open fun isEnabled(key: String, defaultValue: Boolean): Boolean
Reads the enabled state of a flag, falling back to the app's own default.
Link copied to clipboard
open fun logImpression(key: String)
Reports that the user was shown the branch of key, enabled or not.
Link copied to clipboard
Requests fresh flags.
Link copied to clipboard
Unregisters a listener added with addUpdateListener.