feat(android): add exact alarms permission request entry in Settings\n\n- UI: Settings card shows request when exact alarms not allowed\n- Service: wrap canScheduleExactAlarms/requestExactAlarmsPermission via FLN plugin\n- Keeps changes minimal; no new deps\n\nValidation: scripts/check.sh passed
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -248,6 +248,34 @@ class NotificationService {
|
|||||||
return true; // 기본값
|
return true; // 기본값
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Android: 정확 알람 권한 가능 여부 확인 (S+)
|
||||||
|
static Future<bool> canScheduleExactAlarms() async {
|
||||||
|
if (_isWeb) return false;
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
final android = _notifications.resolvePlatformSpecificImplementation<
|
||||||
|
AndroidFlutterLocalNotificationsPlugin>();
|
||||||
|
if (android != null) {
|
||||||
|
final can = await android.canScheduleExactNotifications();
|
||||||
|
return can ?? true; // 하위 버전은 true 간주
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Android: 정확 알람 권한 요청 (Android 12+에서 설정 화면으로 이동)
|
||||||
|
static Future<bool> requestExactAlarmsPermission() async {
|
||||||
|
if (_isWeb) return false;
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
final android = _notifications.resolvePlatformSpecificImplementation<
|
||||||
|
AndroidFlutterLocalNotificationsPlugin>();
|
||||||
|
if (android != null) {
|
||||||
|
final granted = await android.requestExactAlarmsPermission();
|
||||||
|
return granted ?? false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// 알림 스케줄 설정
|
// 알림 스케줄 설정
|
||||||
static Future<void> scheduleNotification({
|
static Future<void> scheduleNotification({
|
||||||
required int id,
|
required int id,
|
||||||
|
|||||||
Reference in New Issue
Block a user