Base #

Read more about the Base system in Hiro here.

Rate app #

Send feedback to the game’s developers over email.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
void onRateAppSuccess()
{
    std::cout << "Successfully rated app!\n";
}

void onError(const Nakama::NError& error)
{
    std::cout << Nakama::toString(error.code) << ": " << error.message << '\n';
}

Hiro::RateAppRequest request;
request.score = 5;
request.message = "I loved it!";

hiroClient->baseRateApp(session, request, onRateAppSuccess, onError);

Set device prefs #

Update or create the mobile push device tokens and preferences for the player.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
void onSetDevicePrefsSuccess()
{
    std::cout << "Successfully set device preferences!\n";
}

void onError(const Nakama::NError& error)
{
    std::cout << Nakama::toString(error.code) << ": " << error.message << '\n';
}

Hiro::DevicePrefsRequest request;
request.deviceId = "device_id";
request.preferences.insert(std::make_pair<std::string,bool>("dark_mode", true));

// Only set one or the other based on device
request.pushTokenAndroid = "android_push_token";
request.pushTokenIos = "ios_push_token";

hiroClient->baseSetDevicePrefs(session, request, onSetDevicePrefsSuccess, onError);