feat(ads): 네이티브 광고 적용 및 디버그 스위치 이동

This commit is contained in:
JiWoong Sul
2025-12-03 17:25:00 +09:00
parent 5cae033977
commit d733bf664b
19 changed files with 461 additions and 168 deletions

View File

@@ -0,0 +1,28 @@
import 'package:flutter/foundation.dart';
import '../constants/app_constants.dart';
class AdHelper {
static bool get isMobilePlatform {
if (kIsWeb) return false;
return defaultTargetPlatform == TargetPlatform.android ||
defaultTargetPlatform == TargetPlatform.iOS;
}
static String get nativeAdUnitId {
if (!isMobilePlatform) {
throw UnsupportedError('Native ads are only supported on mobile.');
}
final isIOS = defaultTargetPlatform == TargetPlatform.iOS;
if (isIOS) {
if (kDebugMode) {
return AppConstants.testIosNativeAdUnitId;
}
return AppConstants.iosNativeAdUnitId;
}
// Android는 디버그/릴리즈 모두 실제 광고 단위 ID 사용
return AppConstants.androidNativeAdUnitId;
}
}