fix(monetization): 광고/보상 로직 버그 수정 및 오프라인 2배 구현

- 인터스티셜 광고 실패 시 onComplete 콜백 미호출 수정
- AdType.rewardReturn 추가, 복귀 보상에 올바른 타입 적용
- SpeedBoostButton 기본 배율 10→5로 수정
- 유료 유저 오프라인 시간 2배 인정 로직 구현
- IAP 상품 ID remove_ads → remove_ads_and 변경
This commit is contained in:
JiWoong Sul
2026-03-09 15:34:21 +09:00
parent fc15198c57
commit f6799e0243
4 changed files with 13 additions and 5 deletions

View File

@@ -20,6 +20,9 @@ enum AdType {
/// 속도업용 인터스티셜 광고 (6초) /// 속도업용 인터스티셜 광고 (6초)
interstitialSpeed, interstitialSpeed,
/// 복귀 보상용 리워드 광고 (30초)
rewardReturn,
} }
/// 광고 결과 /// 광고 결과
@@ -364,6 +367,7 @@ class AdService {
overlays: SystemUiOverlay.values, overlays: SystemUiOverlay.values,
); );
ad.dispose(); ad.dispose();
onComplete();
_loadInterstitialAd(); _loadInterstitialAd();
if (!completer.isCompleted) { if (!completer.isCompleted) {
completer.complete(AdResult.failed); completer.complete(AdResult.failed);

View File

@@ -12,8 +12,7 @@ class IAPProductIds {
IAPProductIds._(); IAPProductIds._();
/// 광고 제거 상품 ID (비소모성) /// 광고 제거 상품 ID (비소모성)
/// TODO: Google Play Console / App Store Connect에서 상품 생성 후 ID 교체 static const String removeAds = 'remove_ads_and';
static const String removeAds = 'remove_ads';
/// 모든 상품 ID 목록 /// 모든 상품 ID 목록
static const Set<String> all = {removeAds}; static const Set<String> all = {removeAds};

View File

@@ -83,8 +83,13 @@ class ReturnRewardsService {
); );
} }
// 유료 유저: 오프라인 시간 2배 인정
final creditedHours = isPaidUser ? hoursAway * 2 : hoursAway;
// 최대 시간 초과 시 최대로 제한 // 최대 시간 초과 시 최대로 제한
final effectiveHours = hoursAway > maxHoursAway ? maxHoursAway : hoursAway; final effectiveHours = creditedHours > maxHoursAway
? maxHoursAway
: creditedHours;
// 상자 개수 계산 // 상자 개수 계산
final maxChests = isPaidUser ? maxChestsPaid : maxChestsFree; final maxChests = isPaidUser ? maxChestsPaid : maxChestsFree;
@@ -163,7 +168,7 @@ class ReturnRewardsService {
// 무료 유저는 리워드 광고 필요 // 무료 유저는 리워드 광고 필요
List<ChestReward> bonusRewards = []; List<ChestReward> bonusRewards = [];
final adResult = await AdService.instance.showRewardedAd( final adResult = await AdService.instance.showRewardedAd(
adType: AdType.rewardRevive, // 복귀 보상용 리워드 광고 adType: AdType.rewardReturn, // 복귀 보상용 리워드 광고
onRewarded: () { onRewarded: () {
bonusRewards = openChests(reward.bonusChestCount, playerLevel); bonusRewards = openChests(reward.bonusChestCount, playerLevel);
}, },

View File

@@ -13,7 +13,7 @@ class SpeedBoostButton extends StatelessWidget {
required this.isActive, required this.isActive,
required this.remainingSeconds, required this.remainingSeconds,
required this.onActivate, required this.onActivate,
this.boostMultiplier = 10, this.boostMultiplier = 5,
}); });
/// 부스트 활성화 여부 /// 부스트 활성화 여부