SwitchToSingletonChildProfile
Switches to a child profile of an app when only one profile exists. If multiple profiles exist this returns an error.
Service | Operation |
---|---|
identity | SWITCH_TO_CHILD_PROFILE |
Method Parameters
Parameter | Description |
---|---|
childAppId | The App ID of the child app to switch to |
forceCreate | Should a new profile be created if it does not exist? |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string childAppId = "1234567";
_bc.IdentityService.SwitchToSingletonChildProfile(
childAppId,
true,
ApiSuccess, ApiError);
const char * childAppId = "1234567";
_bc->getIdentityService()->switchToSingletonChildProfile(
childAppId, true, this);
- (void)switchToSingletonChildProfile:(NSString *)childAppId
forceCreate:(bool)forceCreate
completionBlock:(BCCompletionBlock)cb
errorCompletionBlock:(BCErrorCompletionBlock)ecb
cbObject:(BCCallbackObject)cbObject;
public void switchToSingletonChildProfile(String in_childAppId, boolean in_forceCreate, IServerCallback in_callback)
_bc.identity.switchToSingletonChildProfile = function(childAppId, forceCreate, callback)
var childAppId = "someId";
var forceCreate = true;
ServerResponse result = await _bc.identityService.switchToSingletonChildProfile(childAppId:childAppId, forceCreate:forceCreate);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var childAppId = "123456";
var forceCreate = true;
var identityProxy = bridge.getIdentityServiceProxy();
var retVal = identityProxy.switchToSingletonChildProfile(childAppId, forceCreate);
var childAppId = "123456";
var forceCreate = true;
var identityProxy = bridge.getIdentityServiceProxy();
var retVal = identityProxy.switchToSingletonChildProfile(childAppId, forceCreate);
JSON Response
{
"data": {
"abTestingId": 93,
"lastLogin": 1558725462395,
"server_time": 1558725462431,
"refundCount": 0,
"timeZoneOffset": -5,
"experiencePoints": 0,
"createdAt": 1558462162948,
"parentProfileId": "08ae9b33-3e9d-43d5-835e-7915e0da0fca",
"emailAddress": null,
"experienceLevel": 0,
"countryCode": "CA",
"vcClaimed": 0,
"currency": {},
"id": "e3bf5491-aed5-402c-8eb3-e218e77a58ff",
"amountSpent": 0,
"parentCurrency": {
"Parent": {}
},
"previousLogin": 1558462162950,
"playerName": "",
"pictureUrl": null,
"incoming_events": [],
"languageCode": "en",
"vcPurchased": 0,
"isTester": false,
"loginCount": 2,
"xpCapped": false,
"profileId": "e3bf5491-aed5-402c-8eb3-e218e77a58ff",
"newUser": false,
"sent_events": [],
"rewards": {
"rewardDetails": {},
"currency": {},
"rewards": {}
},
"switchToAppId": "12336",
"statistics": {}
},
"status": 200
}