i8n과 광고 수정
This commit is contained in:
@@ -635,6 +635,8 @@ class NotificationService {
|
||||
try {
|
||||
final expirationDate = subscription.nextBillingDate;
|
||||
final reminderDate = expirationDate.subtract(const Duration(days: 7));
|
||||
final ctx = navigatorKey.currentContext;
|
||||
final loc = ctx != null ? AppLocalizations.of(ctx) : null;
|
||||
|
||||
// tz.local 초기화 확인 및 재시도
|
||||
tz.Location location;
|
||||
@@ -656,8 +658,9 @@ class NotificationService {
|
||||
|
||||
await _notifications.zonedSchedule(
|
||||
('${subscription.id}_expiration').hashCode,
|
||||
'구독 만료 예정 알림',
|
||||
'${subscription.serviceName} 구독이 7일 후 만료됩니다.',
|
||||
loc?.expirationReminder ?? _paymentReminderTitle(_getLocaleCode()),
|
||||
loc?.expirationReminderBody(subscription.serviceName, 7) ??
|
||||
'${subscription.serviceName} subscription expires in 7 days.',
|
||||
tz.TZDateTime.from(reminderDate, location),
|
||||
const NotificationDetails(
|
||||
android: AndroidNotificationDetails(
|
||||
@@ -849,11 +852,14 @@ class NotificationService {
|
||||
if (_isWeb || !_initialized) return;
|
||||
try {
|
||||
final locale = _getLocaleCode();
|
||||
final title = _paymentReminderTitle(locale);
|
||||
final ctx = navigatorKey.currentContext;
|
||||
final loc = ctx != null ? AppLocalizations.of(ctx) : null;
|
||||
final title = loc?.paymentReminder ?? _paymentReminderTitle(locale);
|
||||
final amountText =
|
||||
await CurrencyUtil.formatAmountWithLocale(10000.0, 'KRW', locale);
|
||||
|
||||
final body = '테스트 구독 • $amountText';
|
||||
final body = loc?.testSubscriptionBody(amountText) ??
|
||||
'Test subscription • $amountText';
|
||||
|
||||
await _notifications.show(
|
||||
DateTime.now().millisecondsSinceEpoch.remainder(1 << 31),
|
||||
@@ -880,7 +886,11 @@ class NotificationService {
|
||||
}
|
||||
|
||||
static String getNotificationBody(String serviceName, double amount) {
|
||||
return '$serviceName 구독료 ${amount.toStringAsFixed(0)}원이 결제되었습니다.';
|
||||
final ctx = navigatorKey.currentContext;
|
||||
final loc = ctx != null ? AppLocalizations.of(ctx) : null;
|
||||
final amountText = amount.toStringAsFixed(0);
|
||||
return loc?.paymentChargeNotification(serviceName, amountText) ??
|
||||
'$serviceName subscription charge $amountText was completed.';
|
||||
}
|
||||
|
||||
static Future<String> _buildPaymentBody(
|
||||
@@ -925,6 +935,10 @@ class NotificationService {
|
||||
}
|
||||
|
||||
static String _paymentReminderTitle(String locale) {
|
||||
final ctx = navigatorKey.currentContext;
|
||||
if (ctx != null) {
|
||||
return AppLocalizations.of(ctx).paymentReminder;
|
||||
}
|
||||
switch (locale) {
|
||||
case 'ko':
|
||||
return '결제 예정 알림';
|
||||
|
||||
Reference in New Issue
Block a user