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
voidonSetDevicePrefsSuccess(){std::cout<<"Successfully set device preferences!\n";}voidonError(constNakama::NError&error){std::cout<<Nakama::toString(error.code)<<": "<<error.message<<'\n';}Hiro::DevicePrefsRequestrequest;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);