From 306a8fda30e217fbb802a765b2843143cc44a6a8 Mon Sep 17 00:00:00 2001 From: chahinebrini Date: Wed, 20 May 2026 04:25:15 +0200 Subject: [PATCH] fix(blocker): cooldown-elapsed modal platform-specific (no Android text on iOS) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modal zeigte auf iOS "Du kannst den ReBreak-Bedienungshilfe-Dienst jetzt in den Einstellungen ausschalten" — Bedienungshilfe/Accessibility-Service ist ein Android-Konzept, existiert auf iOS nicht. iOS: NEFilter + Family Controls werden von forceDisable() vollständig abgeschaltet, User muss nichts in Settings tun. Neue iOS-Variante zeigt nur "Cooldown abgelaufen — Schutz deaktiviert." + OK, kein Settings-Button. Android: unverändert (a11y-Service braucht Settings-Deeplink). i18n DE/EN/FR/AR: cooldown_elapsed_message_ios neu. --- .../hooks/useProtectionState.ts | 43 ++++++++++++------- apps/rebreak-native/locales/ar.json | 1 + apps/rebreak-native/locales/de.json | 1 + apps/rebreak-native/locales/en.json | 1 + apps/rebreak-native/locales/fr.json | 1 + 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/apps/rebreak-native/hooks/useProtectionState.ts b/apps/rebreak-native/hooks/useProtectionState.ts index 43ded40..6273694 100644 --- a/apps/rebreak-native/hooks/useProtectionState.ts +++ b/apps/rebreak-native/hooks/useProtectionState.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect, useRef, useState } from 'react'; -import { Alert, AppState, type AppStateStatus } from 'react-native'; +import { Alert, AppState, Platform, type AppStateStatus } from 'react-native'; import { useTranslation } from 'react-i18next'; import { protection, @@ -54,24 +54,37 @@ export function useProtectionState(): UseProtectionStateReturn { const cooldownDisabledNoticeShownRef = useRef(false); // Freundlicher Hinweis nachdem der Cooldown abgelaufen ist und der Schutz - // (inkl. Tamper-Lock) abgeschaltet wurde. Android: a11y-Service kann sich - // nicht selbst deaktivieren → User zu den Einstellungen leiten. + // abgeschaltet wurde. + // Android: a11y-Service (Bedienungshilfe) kann sich nicht selbst + // deaktivieren → User braucht Settings-Deeplink. + // iOS: NEFilter + Family Controls werden von forceDisable() vollständig + // abgeschaltet — User muss NICHTS in den Einstellungen tun. + // Kein "Bedienungshilfe"-Text (gibt es auf iOS nicht), kein + // Settings-Button. const showCooldownElapsedNotice = useCallback(() => { if (cooldownDisabledNoticeShownRef.current) return; cooldownDisabledNoticeShownRef.current = true; - Alert.alert( - t('blocker.cooldown_elapsed_title'), - t('blocker.cooldown_elapsed_message'), - [ - { text: t('common.ok'), style: 'cancel' }, - { - text: t('blocker.cooldown_elapsed_open_settings'), - onPress: () => { - protection.openSystemSettings('accessibility').catch(() => {}); + if (Platform.OS === 'android') { + Alert.alert( + t('blocker.cooldown_elapsed_title'), + t('blocker.cooldown_elapsed_message'), + [ + { text: t('common.ok'), style: 'cancel' }, + { + text: t('blocker.cooldown_elapsed_open_settings'), + onPress: () => { + protection.openSystemSettings('accessibility').catch(() => {}); + }, }, - }, - ], - ); + ], + ); + } else { + Alert.alert( + t('blocker.cooldown_elapsed_title'), + t('blocker.cooldown_elapsed_message_ios'), + [{ text: t('common.ok'), style: 'cancel' }], + ); + } }, [t]); const fetchState = useCallback(async (showLoading = false) => { diff --git a/apps/rebreak-native/locales/ar.json b/apps/rebreak-native/locales/ar.json index fc8e8f5..07cfd68 100644 --- a/apps/rebreak-native/locales/ar.json +++ b/apps/rebreak-native/locales/ar.json @@ -340,6 +340,7 @@ "more_info_title": "تعطيل الحماية", "cooldown_elapsed_title": "الحماية معطّلة", "cooldown_elapsed_message": "انتهت التهدئة — تم تعطيل الحماية. يمكنك الآن إيقاف خدمة إمكانية الوصول لـ ReBreak من الإعدادات.", + "cooldown_elapsed_message_ios": "انتهت التهدئة — تم تعطيل الحماية.", "cooldown_elapsed_open_settings": "فتح الإعدادات", "app_lock_coming_soon_badge": "قريباً", "app_lock_coming_soon_desc": "قفل التطبيق قادم قريباً — الحماية نشطة بالفعل.", diff --git a/apps/rebreak-native/locales/de.json b/apps/rebreak-native/locales/de.json index b5338cc..90983b8 100644 --- a/apps/rebreak-native/locales/de.json +++ b/apps/rebreak-native/locales/de.json @@ -354,6 +354,7 @@ "more_info_title": "Schutz deaktivieren", "cooldown_elapsed_title": "Schutz ist aus", "cooldown_elapsed_message": "Der Cooldown ist abgelaufen — der Schutz wurde deaktiviert. Du kannst den ReBreak-Bedienungshilfe-Dienst jetzt in den Einstellungen ausschalten.", + "cooldown_elapsed_message_ios": "Der Cooldown ist abgelaufen — der Schutz wurde deaktiviert.", "cooldown_elapsed_open_settings": "Einstellungen öffnen", "app_lock_coming_soon_badge": "Bald", "app_lock_coming_soon_desc": "App-Sperre wird bald verfügbar — Schutz ist bereits aktiv.", diff --git a/apps/rebreak-native/locales/en.json b/apps/rebreak-native/locales/en.json index 19dff14..1d88007 100644 --- a/apps/rebreak-native/locales/en.json +++ b/apps/rebreak-native/locales/en.json @@ -354,6 +354,7 @@ "more_info_title": "Disable protection", "cooldown_elapsed_title": "Protection is off", "cooldown_elapsed_message": "The cooldown has elapsed — protection was disabled. You can now turn off the ReBreak accessibility service in Settings.", + "cooldown_elapsed_message_ios": "The cooldown has elapsed — protection was disabled.", "cooldown_elapsed_open_settings": "Open Settings", "app_lock_coming_soon_badge": "Soon", "app_lock_coming_soon_desc": "App lock coming soon — filter protection is already active.", diff --git a/apps/rebreak-native/locales/fr.json b/apps/rebreak-native/locales/fr.json index e096ad9..bc161c1 100644 --- a/apps/rebreak-native/locales/fr.json +++ b/apps/rebreak-native/locales/fr.json @@ -338,6 +338,7 @@ "more_info_title": "Désactiver la protection", "cooldown_elapsed_title": "La protection est désactivée", "cooldown_elapsed_message": "La pause de sécurité est terminée — la protection a été désactivée. Vous pouvez maintenant désactiver le service d'accessibilité ReBreak dans les Réglages.", + "cooldown_elapsed_message_ios": "La pause de sécurité est terminée — la protection a été désactivée.", "cooldown_elapsed_open_settings": "Ouvrir les Réglages", "app_lock_coming_soon_badge": "Bientôt", "app_lock_coming_soon_desc": "Verrouillage de l'app bientôt disponible — la protection par filtre est déjà active.",