Client
The BrainCloudClient class is the core of the brainCloud API. From the BrainCloudClient you can access all of brainCloud's services (Authentication, Entity, etc) and from there the individual API's they contain.
The Client also contains many setup and configuration methods for timeouts, global callbacks, and more.
API Summary
Critical
Functions that are necessary to use the brianCloud library.
Callbacks
Functions to register and deregister callbacks for specific events.
Timeouts
Functions to configure network timeouts.
- SetPacketTimeoutsToDefault
- GetPacketTimeouts
- SetPacketTimeouts
- GetAuthenticationPacketTimeout
- SetAuthenticationPacketTimeout
Status
Functions to query the client state or reset network communications.
- IsAuthenticated
- IsInitialized
- GetSessionId
- ResetCommunication
- InsertEndOfMessageBundleMarker
- OverrideCountryCode
- OverrideLanguageCode
- EnableLogging
File Upload
Functions to register for file upload callbacks and configure upload specific timeouts.
- RegisterFileUploadCallback
- DeregisterFileUploadCallback
- GetUploadLowTransferRateThreshold
- SetUploadLowTransferRateThreshold
- GetUploadLowTransferRateTimeout
- SetUploadLowTransferRateTimeout
Network Error Caching
Functions to enable and manage network error message caching.
- EnableNetworkErrorMessageCaching
- RegisterNetworkErrorCallback
- RetryCachedMessages
- FlushCachedMessages
Global Error Logging
Functions to register and deregister callbacks for all error events.
Compatibility
Compatibility settings for older brainCloud versions.
📄️ DeregisterEventCallback
Deregisters the event callback.
📄️ DeregisterFileUploadCallback
Deregisters the file upload callback
📄️ DeregisterGlobalErrorCallback
Deregisters the global error callback.
📄️ DeregisterNetworkErrorCallback
Deregisters the network error callback.
📄️ DeregisterRewardCallback
Deregisters the event callback.
📄️ EnableCompressedRequests
Enables sending Gzip compressed packets of requests from client side. Which can significantely decrease response time for requests with large body content.
📄️ EnableCompressedResponses
Enables receiving compressed packets of responses.
📄️ EnableLogging
Enables console logging of outgoing/incoming packets and other informational logs from the client.
📄️ EnableNetworkErrorMessageCaching
Enables the timeout message caching which is disabled by default. Once enabled, if a client side timeout is encountered (i.e. server is unreachable presumably due to the client network being down) the SDK will do the following:
📄️ FlushCachedMessages
Flushes the cached messages to resume API call processing. This will dump all of the cached messages in the queue.
📄️ GetAppId
Returns the app id of the client app.
📄️ GetAppVersion
Returns the app version of the client app.
📄️ GetAuthenticationPacketTimeout
Gets the authentication packet timeout which is tracked separately from all other packets. Note that authentication packets are never retried and so this value represents the total time a client would wait to receive a reply to an authentication API call.
📄️ GetPacketTimeouts
Returns the list of packet timeouts.
📄️ GetSessionId
Returns the session id if a connection with has been established.
📄️ GetUploadLowTransferRateThreshold
Returns the low transfer rate threshold in bytes/sec.
📄️ GetUploadLowTransferRateTimeout
Returns the low transfer rate timeout in seconds.
📄️ Initialize
To initialize, use this code:
📄️ InitializeIdentity
Initializes the authentication service with an anonymous installation ID and most recently used profile ID.
📄️ InsertEndOfMessageBundleMarker
Inserts a marker which will tell the comms layer to close the message bundle off at this point. Any messages queued before this method was called will likely be bundled together in the next send to the server.
📄️ IsAuthenticated
Returns true if the user is authenticated.
📄️ IsInitialized
Returns whether the has been initialized using the Initialize() method.
📄️ OverrideCountryCode
Sets the country code sent to when a user authenticates. Will override any auto detected country.