C Client-Side SDK
LaunchDarkly SDK
|
|
Go to the documentation of this file.
21 #define LDPrimaryEnvironmentName "default"
26 LDStatusInitializing = 0,
44 struct LDJSON *reason;
74 struct LDConfig *
const config,
76 const unsigned int maxwaitmilli);
117 struct LDClient *
const client,
const unsigned int timeoutmilli);
131 struct LDClient *
const client,
const LDBoolean background);
171 struct LDClient * client,
172 const struct LDUser *currentUser,
173 const struct LDUser *previousUser);
177 LDClientTrack(
struct LDClient *
const client,
const char *
const name);
182 struct LDClient *
const client,
183 const char *
const name,
184 struct LDJSON *
const data);
189 struct LDClient *
const client,
190 const char *
const name,
191 struct LDJSON *
const data,
192 const double metric);
201 struct LDClient *
const client,
202 const char *
const featureKey,
203 const LDBoolean fallback);
210 struct LDClient *
const client,
211 const char *
const featureKey,
217 struct LDClient *
const client,
218 const char *
const featureKey,
219 const double fallback);
224 struct LDClient *
const client,
225 const char *
const featureKey,
226 const char *
const fallback);
231 struct LDClient *
const client,
232 const char *
const featureKey,
233 const char *
const fallback,
234 char *
const resultBuffer,
235 const size_t resultBufferSize);
240 struct LDClient *
const client,
241 const char *
const featureKey,
242 const struct LDJSON *
const fallback);
247 struct LDClient *
const client,
248 const char *
const featureKey,
249 const LDBoolean fallback,
257 struct LDClient *
const client,
258 const char *
const featureKey,
265 struct LDClient *
const client,
266 const char *
const featureKey,
267 const double fallback,
273 struct LDClient *
const client,
274 const char *
const featureKey,
275 const char *
const fallback,
281 struct LDClient *
const client,
282 const char *
const featureKey,
283 const char *
const fallback,
284 char *
const resultBuffer,
285 const size_t resultBufferSize,
291 struct LDClient *
const client,
292 const char *
const key,
293 const struct LDJSON *
const fallback,
303 typedef void (*
LDlistenerfn)(
const char *
const flagKey,
const int status);
308 struct LDClient *
const client,
309 const char *
const flagKey,
316 struct LDClient *
const client,
317 const char *
const flagKey,
void LDClientTrackData(struct LDClient *const client, const char *const name, struct LDJSON *const data)
Record a custom event and include custom data.
void LDSetClientStatusCallback(void(callback)(int status))
Add callback for client status changes, replacing any existing callback (including any set with LDSet...
char * LDStringVariation(struct LDClient *const client, const char *const featureKey, const char *const fallback, char *const resultBuffer, const size_t resultBufferSize)
Evaluate String flag into fixed buffer.
LDBoolean LDClientIsInitialized(struct LDClient *const client)
Returns true if the client has been initialized.
char * LDStringVariationAllocDetail(struct LDClient *const client, const char *const featureKey, const char *const fallback, LDVariationDetails *const details)
Evaluate String flag with details.
void LDFreeDetailContents(LDVariationDetails details)
Clear any memory associated with LDVariationDetails
struct LDClient * LDClientInit(struct LDConfig *const config, struct LDUser *const user, const unsigned int maxwaitmilli)
Initialize the client with the config and user. After this call,.
LDBoolean LDClientAwaitInitialized(struct LDClient *const client, const unsigned int timeoutmilli)
Block until initialized up to timeout, returns true if initialized.
A custom c89 boolean type.
void LDClientTrack(struct LDClient *const client, const char *const name)
Record a custom event.
int LDIntVariation(struct LDClient *const client, const char *const featureKey, const int fallback)
Evaluate Int flag.
void LDClientSetOffline(struct LDClient *const client)
Make the client operate in offline mode. No network traffic.
@ LDStatusShutdown
Definition: client.h:33
void(* LDstatusfn)(LDStatus status, void *userData)
Status callback type.
Definition: client.h:155
void LDClientIdentify(struct LDClient *const client, struct LDUser *const user)
Asynchronously update the client with a new user.
void LDSetClientStatusCallbackUserData(LDstatusfn callback, void *userData)
Add callback for client status changes, replacing any existing callback (including any set with LDSet...
void LDClientSetOnline(struct LDClient *const client)
Return the client to online mode.
double LDDoubleVariation(struct LDClient *const client, const char *const featureKey, const double fallback)
Evaluate Double flag.
char * LDClientSaveFlags(struct LDClient *const client)
Get JSON string containing all flags.
void LDClientClose(struct LDClient *const client)
Close the client, free resources, and generally shut down.
struct LDJSON * LDJSONVariationDetail(struct LDClient *const client, const char *const key, const struct LDJSON *const fallback, LDVariationDetails *const details)
Evaluate JSON flag with details.
void LDClientAlias(struct LDClient *client, const struct LDUser *currentUser, const struct LDUser *previousUser)
Record a alias event.
void LDClientFlush(struct LDClient *const client)
Send any pending events to the server. They will normally be.
LDBoolean LDClientRestoreFlags(struct LDClient *const client, const char *const data)
Set flag store from JSON string.
#define LD_EXPORT(x)
Used to ensure only intended symbols are exported in the binaries.
Definition: export.h:10
LDStatus
Current status of the client.
Definition: client.h:24
To use detail variations you must provide a pointer to an LDVariationDetails struct that will be fill...
Definition: client.h:41
void LDClientSetBackground(struct LDClient *const client, const LDBoolean background)
Enable or disable polling mode.
int LDIntVariationDetail(struct LDClient *const client, const char *const featureKey, const int fallback, LDVariationDetails *const details)
Evaluate Int flag with details.
char * LDStringVariationAlloc(struct LDClient *const client, const char *const featureKey, const char *const fallback)
Evaluate String flag.
double LDDoubleVariationDetail(struct LDClient *const client, const char *const featureKey, const double fallback, LDVariationDetails *const details)
Evaluate Double flag with details.
LDBoolean LDBoolVariationDetail(struct LDClient *const client, const char *const featureKey, const LDBoolean fallback, LDVariationDetails *const details)
Evaluate Bool flag with details.
void LDClientUnregisterFeatureFlagListener(struct LDClient *const client, const char *const flagKey, LDlistenerfn listener)
Unregister a callback registered with LDClientRegisterFeatureFlagListener
struct LDJSON * LDJSONVariation(struct LDClient *const client, const char *const featureKey, const struct LDJSON *const fallback)
Evaluate JSON flag.
void LDClientTrackMetric(struct LDClient *const client, const char *const name, struct LDJSON *const data, const double metric)
Record a custom event and include custom data / a metric.
LDBoolean LDClientRegisterFeatureFlagListener(struct LDClient *const client, const char *const flagKey, LDlistenerfn listener)
Register a callback for when a flag is updated.
Public API Interface for User construction.
Public API Interface for JSON usage.
struct LDJSON * LDAllFlags(struct LDClient *const client)
Returns an object of all flags. This must be freed with LDJSONFree.
Public API Interface for Configuration.
void(* LDlistenerfn)(const char *const flagKey, const int status)
Feature flag listener callback type. Callbacks are not reentrant safe.
Definition: client.h:303
struct LDClient * LDClientGetForMobileKey(const char *const keyName)
Get a reference to a secondary environment established in the configuration.
LDBoolean LDClientIsOffline(struct LDClient *const client)
Returns the offline status of the client.
struct LDClient * LDClientGet(void)
Get a reference to the (single, global) client.
char * LDStringVariationDetail(struct LDClient *const client, const char *const featureKey, const char *const fallback, char *const resultBuffer, const size_t resultBufferSize, LDVariationDetails *const details)
Evaluate String flag into fixed buffer with details.
LDBoolean LDBoolVariation(struct LDClient *const client, const char *const featureKey, const LDBoolean fallback)
Evaluate Bool flag.
Public. Configuration of exported symbols.