# Base

**URL:** https://heroiclabs.com/docs/hiro/cpp/base/
**Keywords:** base, hiro
**Categories:** hiro, cpp, base

---


# Base

Read more about the Base system in Hiro [here](../../concepts/base/).

## Rate app
Send feedback to the game's developers over email.

```cpp
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.

```cpp
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);
```