isTester
is a useful flag that can help keep tester actions such as purchases and level-up behaviors out of the general pool of reporting of the player base.
When an account is created by your app operator, if a credential (email/universal ID) is supplied, it will check if there is an exact match in the APP’s isTester Whitelist, if yes, then mark this account as a tester account.
This means that apps with a purchase experience during onboarding can be tested more easily by testers without causing their purchase to get lumped in with real purchases.
To accomplish this, the first step is to establish a tester whitelist within your app's global property or other designated data types. For this example, the global property will be used as shown below.
Then create a cloud code script to retrieve a list of testers and compare any newly created users. If a user's credentials are found on the list, they will be marked as a tester.
"use strict";
function main() {
var response = {};
var credential = data.callingMessage.externalId;
var message = data.message;
var propName = "tester";
var prop = bridge.getGlobalProperty(propName);
var propJson = JSON.parse(prop);
var credentials = propJson.credentials;
if (credentials.includes(credential)) {
var playerStateProxy = bridge.getPlayerStateServiceProxy();
var postResult = playerStateProxy.updateIsTester(true);
if (postResult.status == 200) {
// Success!
message.postHooked = true;
message.testerCheck = "this User is marked as tester via auth_posthook"
}
}
response.status = 200
response.data = message;
return response;
}
main();
Finally, set this script to hook up as Authentication Post API hook as below
Done! The task has been completed. You may verify whether the tester account has been automatically designated as such by accessing the User Summary page.