BrainCloudClient class

Constructors

BrainCloudClient(BrainCloudWrapper? inWrapper)

Properties

appId String
no setter
appStoreService BrainCloudAppStore
no setter
appVersion String
no setter
asyncMatchService BrainCloudAsyncMatch
no setter
authenticated bool
no setter
authenticationService BrainCloudAuthentication
no setter
blockchainService BrainCloudBlockchain
no setter
brainCloudClientVersion String
no setter
chatService BrainCloudChat
no setter
comms → BrainCloudComms
no setter
countryCode String
getter/setter pair
customEntityService BrainCloudCustomEntity
no setter
dataStreamService BrainCloudDataStream
no setter
entityService BrainCloudEntity
no setter
eventService BrainCloudEvent
no setter
fileService BrainCloudFile
no setter
friendService BrainCloudFriend
no setter
gamificationService BrainCloudGamification
no setter
globalAppService BrainCloudGlobalApp
no setter
globalEntityService BrainCloudGlobalEntity
no setter
globalFileService BrainCloudGlobalFile
no setter
globalStatisticsService BrainCloudGlobalStatistics
no setter
groupFileService BrainCloudGroupFile
no setter
groupService BrainCloudGroup
no setter
hashCode int
The hash code for this object.
no setterinherited
identityService BrainCloudIdentity
no setter
initialized bool
no setter
itemCatalogService BrainCloudItemCatalog
no setter
languageCode String
getter/setter pair
leaderboardService BrainCloudSocialLeaderboard
no setter
lobbyService BrainCloudLobby
no setter
loggingEnabled bool
no setter
mailService BrainCloudMail
no setter
matchMakingService BrainCloudMatchMaking
no setter
messagingService BrainCloudMessaging
no setter
oneWayMatchService BrainCloudOneWayMatch
no setter
platform ← dynamic
no getter
playbackStreamService BrainCloudPlaybackStream
no setter
playerStateService BrainCloudPlayerState
no setter
playerStatisticsEventService BrainCloudPlayerStatisticsEvent
no setter
playerStatisticsService BrainCloudPlayerStatistics
no setter
presenceService BrainCloudPresence
no setter
profanityService BrainCloudProfanity
no setter
profileId String?
no setter
pushNotificationService BrainCloudPushNotification
no setter
redemptionCodeService BrainCloudRedemptionCode
no setter
relayService BrainCloudRelay
no setter
releasePlatform PlatformID
no setter
rsComms → RelayComms
no setter
rttComms → RTTComms
no setter
rttConnectionID String?
no setter
rttEventServer String?
no setter
rttService BrainCloudRTT
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scriptService BrainCloudScript
no setter
sessionID String
returns the sessionId or empty String if no session present.
no setter
socialLeaderboardService BrainCloudSocialLeaderboard
no setter
timeService BrainCloudTime
no setter
tournamentService BrainCloudTournament
no setter
userItemsService BrainCloudUserItems
no setter
virtualCurrencyService BrainCloudVirtualCurrency
no setter
wrapper BrainCloudWrapper
getter/setter pair

Methods

deregisterEventCallback() → void
De-registers the event callback.
deregisterFileUploadCallback() → void
De-registers the file upload callbacks.
deregisterGlobalErrorCallback() → void
De-registers the global error callback.
deregisterNetworkErrorCallback() → void
De-registers the network error callback.
deregisterRewardCallback() → void
De-registers the reward callback.
deserializeJson(String jsonData) Map<String, dynamic>
enableCommunications(bool value) → void
Enable Communications with the server. By default this is true
enableCompressedRequests(bool isEnabled) → void
enableCompressedResponses(bool isEnabled) → void
enableLogging(bool enable) → void
Enable logging of brainCloud transactions (comms etc)
enableNetworkErrorMessageCaching(bool enabled) → void
Enables the timeout message caching which is disabled by default. Once enabled, if a client side timeout is encountered (i.e. brainCloud server is unreachable presumably due to the client network being down) the SDK will do the following:
flushCachedMessages(bool sendApiErrorCallbacks) → void
Flushes the cached messages to resume API call processing. This will dump all of the cached messages in the queue.
getAppId() String
getAppVersion() String
getAuthenticationPacketTimeout() int
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. By default this timeout is set to 15 seconds.
getPacketTimeouts() List<int>
Returns the list of packet timeouts.
getReceivedPacketId() int
getSessionId() String
returns the sessionId or empty String if no session present.
getUploadLowTransferRateThreshold() int
Returns the low transfer rate threshold in bytes/sec
getUploadLowTransferRateTimeout() int
Returns the low transfer rate timeout in secs
getUrl() String
Get the Server URL
init() → void
initialize({String? serverURL = defaultServerURL, required dynamic secretKey, required dynamic appId, required dynamic appVersion}) → void
Method initializes the BrainCloudClient.
initializeHelper(String serverURL, String secretKey, String appId, String appVersion) String?
initializeIdentity(String profileId, String anonymousId) → void
Initialize the identity aspects of brainCloud.
initializeWithApps({String serverURL = defaultServerURL, required String defaultAppId, required Map<String, String> appIdSecretMap, required String appVersion}) → void
Method initializes the BrainCloudClient.
insertEndOfMessageBundleMarker() → void
Inserts a marker which will tell the brainCloud 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() bool
Returns true if the user is currently authenticated. If a session time out or session invalidation is returned from executing a sever API call, this flag will reset back to false.
isInitialized() bool
Returns true if brainCloud has been initialized.
log(String log, {bool bypassLogEnabled = false}) → void
Method writes log if logging is enabled
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
overrideCountryCode(String countryCode) → void
Sets the country code sent to brainCloud when a user authenticates. Will override any auto detected country.
overrideLanguageCode(String languageCode) → void
Sets the language code sent to brainCloud when a user authenticates. If the language is set to a non-ISO 639-1 standard value the game default will be used instead. Will override any auto detected language.
registerEventCallback(EventCallback eventCallback) → void
Sets a callback handler for any out of band event messages that come from brainCloud.
registerFileUploadCallback(dynamic callBack(ServerResponse)) → void
Registers the file upload callbacks.
registerGlobalErrorCallback(FailureGlobalCallback callback) → void
Failure callback invoked for all errors generated
registerNetworkErrorCallback(NetworkErrorCallback callback) → void
Registers a callback that is invoked for network errors.
registerRewardCallback(RewardCallback eventCallback) → void
Sets a reward handler for any API call results that return rewards.
resetCommunication() → void
Resets all messages and calls to the server
retryCachedMessages() → void
Attempts to resend any cached messages. If no messages are in the cache, this method does nothing.
runCallbacks({BrainCloudUpdateType inUpdateType = BrainCloudUpdateType.all}) → void
Update method needs to be called regularly in order to process incoming and outgoing messages.
sendHeartbeat() Future<ServerResponse>
Normally not needed as the brainCloud SDK sends heartbeats automatically. Regardless, this is a manual way to send a heartbeat.
sendRequest(ServerCall serviceMessage) → void
Sends a service request message to the server.
serializeJson(dynamic payLoad) String
setAuthenticationPacketTimeout(int timeoutSecs) → void
Sets 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. By default this timeout is set to 15 seconds.
setPacketTimeouts(List<int> timeouts) → void
Sets the packet timeouts using a list of integers that represent timeout values for each packet retry. The first item in the list represents the timeout for the first packet attempt, the second for the second packet attempt, and so on.
setPacketTimeoutsToDefault() → void
Sets the packet timeouts back to default.
setUploadLowTransferRateThreshold(int bytesPerSec) → void
Sets the low transfer rate threshold of an upload in bytes/sec. If the transfer rate dips below the given threshold longer than the specified timeout, the transfer will fail. By default this is set to 50 bytes/sec.
setUploadLowTransferRateTimeout(int timeoutSecs) → void
Sets the timeout in seconds of a low speed upload (i.e. transfer rate which is underneath the low transfer rate threshold). By default this is set to 120 secs.Setting this value to 0 will turn off the timeout.
shutDown() → void
Shuts down all systems needed for BrainCloudClient
toString() String
A string representation of this object.
inherited
update({BrainCloudUpdateType inUpdateType = BrainCloudUpdateType.all}) → void
Update method needs to be called regularly in order to process incoming and outgoing messages.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

createServerCallback(SuccessCallback? success, FailureCallback? failure) → ServerCallback?

Constants

defaultServerURL → const String