Initialize
To initialize, use this code:
This method initializes the brainCloud client SDK. The information required to initialize can be found on the Application IDs page of the portal.
caution
Initialize must be called before you can call any brainCloud APIs.
Method Parameters
Parameter | Description |
---|---|
serverUrl | The url of the brainCloud server. |
secretKey | The secret key for your app found in the brainCloud portal. |
appId | The id of your app found in the brainCloud portal. |
appVersion | The version of your app. This can be used to prevent older versions of your app from logging into brainCloud. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// If you're using Unity, you can make use of the brainCloudSettings toolbar
string serverUrl = "https://api.braincloudservers.com/dispatcherv2";
string secret = "1234-1234-1234-1234";
string appId = "123456";
_bc.Initialize(serverUrl, secret, appId, "1.0.0");
const char* serverUrl = "https://api.braincloudservers.com/dispatcherv2";
const char* secret = "1234-1234-1234-1234";
const char* appId = "123456";
_bc->initialize(serverUrl, secret, appId, "1.0.0");
NSString* serverUrl = @"https://api.braincloudservers.com/dispatcherv2";
NSString* secret = @"1234-1234-1234-1234";
NSString* appId = @"123456";
[_bc initialize:serverUrl
secretKey:secret
appId:appId
appVersion:"1.0.0"];
String serverUrl = "https://api.braincloudservers.com/dispatcherv2";
String secret = "1234-1234-1234-1234";
String appId = "123456";
_bc.initialize(appId, secret, "1.0.0", serverUrl);
var serverUrl = "https://api.braincloudservers.com/dispatcherv2";
var secret = "1234-1234-1234-1234";
var appId = "123456";
_bc.initialize(appId, secret, "1.0.0");
var serverUrl = "https://api.braincloudservers.com/dispatcherv2"; //Optional parameter
var secretKey = "1234-1234-1234-1234";
var appId = "123456";
var appVersion = "1.0.0";
_bc.initialize(serverUrl:serverUrl, secretKey:secretKey, appId:appId, appVersion:appVersion);
// N/A
// N/A