Skip to main content
Version: 6.1.0

InitializeWithApps

Method initializes BrainCloudWrapper and BrainCloudClient with a map of appid->secretkey.

The parameters for this method vary by client (for example the Unity client takes none at all, as all data is pulled from the brainCloud editor menu data).

Method Parameters​

ParameterDescription
serverURLThe URL to the brainCloud server
appIdThe default app ID
secretMapAll app ids to secret keys used by this application
versionThe app version
companyNameClient dependent - The company name used in the keychain for storing anonymous and profile IDs. You are free to pick anything you want.
appNameClient dependent - The app name used in the keychain for storing anonymous and profile IDs. You are free to pick anything you want.

Usage​

http://localhost:3000
// Unity
GameObject go = new GameObject();
_bc = go.AddComponent<BrainCloudWrapper>();
_bc.WrapperName = _wrapperName; // optionally set a wrapper-name
_bc.InitWithApps(); // extra data, such as: _appId, _secret and _appVersion, is taken from the brainCloud Unity Plugin.
DontDestroyOnLoad(go); // keep the brainCloud game object through scene changes

// C#
string serverUrl = "https://api.braincloudservers.com/dispatcherv2";
string secret = `<%= data.example.appSecret %>`;
string appId = `<%= data.example.appId %>`;
string childSecret = `<%= data.example.appChildSecret %>`;
string childAppId = `<%= data.example.appChildId %>`;
Dictionary<string, string> secretMap = new Dictionary<string, string>();
secretMap.Add(appId, secret);
secretMap.Add(childAppId, childSecret);
string version = `<%= data.example.appVersion %>`;

_bc = new BrainCloudWrapper();
_bc.InitWithApps(serverUrl, appId, secretMap, version);
JSON Response