claimDailyReward function
Future
claimDailyReward(
- int uid, {
- bool chinese = false,
- dynamic lang = 'en-us',
})
Implementation
Future claimDailyReward(int uid, {bool chinese = false, lang = 'en-us'}) async {
var info = await getDailyRewardInfo(chinese: chinese);
if (info.signedIn) return;
const params = {};
if (chinese) {
params['game_uid'] = uid;
params['region'] = recognizeServer(uid);
}
params['lang'] = lang;
await fetchDailyEndpoint('sign',
chinese: chinese, kwargs: {'method': 'POST', 'params': params});
var rewards = await getMonthlyReward(chinese: chinese, lang: lang);
return rewards[info.claimedReward];
}