overall ui bugfixes and hivemind improvements

This commit is contained in:
esefxdz committed 2026-05-31 13:16:46 +03:00
1 parent a80a23e008
commit 8f32429e82
10 files changed
+125 -158

No files matched your search

+4 -3
View File
@@ -94,8 +94,8 @@ class AdManager extends ChangeNotifier {
final keys = await CryptoService.getOrCreateKeys();
final pubKey = keys['publicKey']!;
// 3. Attach custom data to the ad so Google sends it back to our Hivemind server
_rewardedAd!.serverSideVerificationOptions = ServerSideVerificationOptions(
// 3. Build SSV options to send to our Hivemind server via Google's callback
final ssvOptions = ServerSideVerificationOptions(
customData: jsonEncode({
'device_id': deviceId,
'public_key': pubKey,
@@ -130,7 +130,8 @@ class AdManager extends ChangeNotifier {
},
);
// 5. Show the ad
// 5. Show the ad with SSV options
_rewardedAd!.setServerSideOptions(ssvOptions);
await _rewardedAd!.show(
onUserEarnedReward: (AdWithoutView ad, RewardItem reward) {
debugPrint('[AdManager] Reward earned: ${reward.amount} ${reward.type}');