From 95c64b36f5e687e9f4cfd96b72160df6a29061a3 Mon Sep 17 00:00:00 2001 From: Nikolay <72947676+svyatoynick@users.noreply.github.com> Date: Wed, 15 Jun 2022 16:48:26 +0300 Subject: [PATCH 01/63] Cleaned localisations. --- .../Localization/ar.lproj/Localizable.strings | 58 +------------------ .../Localization/de.lproj/Localizable.strings | 56 ------------------ .../Localization/en.lproj/Localizable.strings | 56 ------------------ .../Localization/es.lproj/Localizable.strings | 57 ------------------ .../Localization/fa.lproj/Localizable.strings | 56 ------------------ .../Localization/fr.lproj/Localizable.strings | 56 ------------------ .../Localization/it.lproj/Localizable.strings | 56 ------------------ .../Localization/nl.lproj/Localizable.strings | 56 ------------------ .../Localization/pl.lproj/Localizable.strings | 56 ------------------ .../Localization/pt.lproj/Localizable.strings | 56 ------------------ .../Localization/ru.lproj/Localizable.strings | 56 ------------------ .../Localization/uk.lproj/Localizable.strings | 56 ------------------ .../zh-Hant.lproj/Localizable.strings | 56 ------------------ .../zh_Hans.lproj/Localizable.strings | 56 ------------------ 14 files changed, 1 insertion(+), 786 deletions(-) diff --git a/Sources/PermissionsKit/Resources/Localization/ar.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/ar.lproj/Localizable.strings index 76af0ec5..93d7526a 100644 --- a/Sources/PermissionsKit/Resources/Localization/ar.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/ar.lproj/Localizable.strings @@ -1,89 +1,33 @@ -"action allow" = "استمرار"; - -"action allowed" = "تم السماح"; - -"titles header" = "إدارة الصلاحيات"; - -"titles sub header" = "الصلاحيات"; - -"titles description" = "هذه الصلاحيات التي يتطلبها التطبيق ليعمل بشكل صحيح."; - -"titles comment" = "منح الصلاحيات يمكنك من تحقيق أقصى إستفادة من مميزات التطبيق"; - "permission camera name" = "الكاميرا"; -"permission camera description" = "السماح للتطبيق بالوصول الى الكاميرا"; - "permission photoLibrary name" = "الاستوديو"; -"permission photoLibrary description" = "ليتمكن التطبيق من حفظ او استيراد الصور من والى الاستوديو"; - "permission microphone name" = "المايكروفون"; -"permission microphone description" = "السماح بإستخدام المايكروفون"; - "permission calendar name" = "التقويم"; -"permission calendar description" = "السماح بالوصول الكامل الى التقويم"; - "permission contacts name" = "جهات الاتصال"; -"permission contacts description" = "الوصول إلى جهات الاتصال"; - "permission reminders name" = "التذكيرات"; -"permission reminders description" = "السماح للتطبيق بالوصول الكامل الى التذكيرات"; - -"permission speech name" = "التحدث"; - -"permission speech description" = "السماح بالتحقق من صوتك"; +"permission speech name" = "التحدث";= "permission motion name" = "الحركة"; -"permission motion description" = "السماح بتسجيل البيانات المتعلقة بالحركة والبيئة"; - "permission media library name" = "الموسيقى"; -"permission media library description" = "السماح للوصول الى مكتبة الموسيقى"; - "permission bluetooth name" = "البلوتوث"; -"permission bluetooth description" = "السماح بإستخدام البلوتوث"; - "permission notification name" = "الإشعارات"; -"permission notification description" = "لإستقبال التنبيهات دون فتح التطبيق."; - "permission location when in use name" = "الموقع عند الاستخدام"; -"permission location when in use description" = "السماح للوصول إلى موقعك عند استخدام التطبيق فقط"; - "permission location always name" = "الموقع دائما"; -"permission location always description" = "السماح دائماً للوصول إلى موقعك"; - "permission tracking name" = "تتبع"; -"permission tracking description" = "السماح بالوصول إلى البيانات المتعلقة بالتطبيق"; - "permission faceid name" = "FaceID"; -"permission faceid description" = "السماح باستخدام بصمة الوجه Face ID"; - "permission siri name" = "سيري"; -"permission siri description" = "تمكين استخدام سيري"; - "permission health name" = "الصحة"; - -"permission health description" = "السماح بالوصول إلى البيانات الصحية"; - -"denied alert title" = "تعديل الرفض"; - -"denied alert description" = "لإعادة منح الصلاحيات يرجى الذهاب الى الإعدادات"; - -"denied alert action" = "الذهاب الى الإعدادات"; - -"denied alert cancel" = "الغاء"; - -"action denied" = "تم الرفض"; diff --git a/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings index e0673f44..a1b27444 100644 --- a/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings @@ -1,89 +1,33 @@ -"action allow" = "Fortsetzen"; - -"action allowed" = "Dürfen"; - -"titles header" = "Benötigen Sie die Erlaubnis"; - -"titles sub header" = "Berechtigungsanfrage"; - -"titles description" = "Dies sind die Berechtigungen, die die App benötigt, um richtig zu funktionieren. Bitte lesen Sie die Beschreibung für jede Berechtigung."; - -"titles comment" = "Berechtigungen sind notwendig, damit die Anwendung funktioniert und korrekt arbeitet. Push sind nicht erforderliche Berechtigungen"; - "permission camera name" = "Kamera"; -"permission camera description" = "App zur Verwendung der Kamera zulassen"; - "permission photoLibrary name" = "Foto-Bibliothek"; -"permission photoLibrary description" = "Zugang zum Speichern von Fotos in Ihrer Galerie"; - "permission microphone name" = "Mikrofon"; -"permission microphone description" = "Sprachaufzeichnung aus der App heraus zulassen"; - "permission calendar name" = "Kalender"; -"permission calendar description" = "Anwendung kann Ereignisse zum Kalender hinzufügen"; - "permission contacts name" = "Kontakte"; -"permission contacts description" = "Zugriff für Ihre Kontakte und Telefone"; - "permission reminders name" = "Mahnungen"; -"permission reminders description" = "Anwendung kann neue Aufgabe erstellen"; - "permission speech name" = "Sprechen"; -"permission speech description" = "Erlauben Sie die Überprüfung Ihrer Stimme"; - "permission motion name" = "Bewegung"; -"permission motion description" = "Erlaubt die Aufzeichnung von bewegungs- und umgebungsbezogenen Daten"; - "permission media library name" = "Medienbibliothek"; -"permission media library description" = "Erlauben Sie die Überprüfung Ihrer Medien"; - "permission bluetooth name" = "Bluetooth"; -"permission bluetooth description" = "Zugriff auf Bluetooth zulassen"; - "permission notification name" = "Benachrichtigung"; -"permission notification description" = "Erhalten Sie wichtige Informationen, ohne die App zu öffnen."; - "permission location when in use name" = "Standort bei Verwendung"; -"permission location when in use description" = "Erlauben Sie den Zugriff auf Ihren Standort"; - "permission location always name" = "Standort Immer"; -"permission location always description" = "Erlauben Sie den Zugriff auf Ihren Standort"; - "permission tracking name" = "Nachverfolgung"; -"permission tracking description" = "Zugriff auf app-bezogene Daten zulassen"; - "permission faceid name" = "FaceID"; -"permission faceid description" = "Erlauben Sie die Verwendung der Face ID-Identität"; - "permission siri name" = "Siri"; -"permission siri description" = "Sie werden Siri verwenden können"; - "permission health name" = "Gesundheit"; - -"permission health description" = "Zugriff auf Gesundheitsdaten zulassen"; - -"denied alert title" = "Berechtigung verweigert"; - -"denied alert description" = "Bitte gehen Sie zu Einstellungen und erlauben Sie die Erlaubnis."; - -"denied alert action" = "Einstellungen"; - -"denied alert cancel" = "Abbrechen"; - -"action denied" = "Abgelehnt"; diff --git a/Sources/PermissionsKit/Resources/Localization/en.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/en.lproj/Localizable.strings index 7771ffab..634fc87d 100644 --- a/Sources/PermissionsKit/Resources/Localization/en.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/en.lproj/Localizable.strings @@ -1,89 +1,33 @@ -"action allow" = "Continue"; - -"action allowed" = "Allowed"; - -"titles header" = "Need Permission"; - -"titles sub header" = "Permissions request"; - -"titles description" = "These are the permissions the app requires to work properly. Please see description for each permission."; - -"titles comment" = "Permissions are necessary for the application to work and perform correctly. Push are not required permissions"; - "permission camera name" = "Camera"; -"permission camera description" = "Allow app for use camera"; - "permission photoLibrary name" = "Photo Library"; -"permission photoLibrary description" = "Access for save photos in your gallery"; - "permission microphone name" = "Microphone"; -"permission microphone description" = "Allow record voice from app"; - "permission calendar name" = "Calendar"; -"permission calendar description" = "Application can add events to calendar"; - "permission contacts name" = "Contacts"; -"permission contacts description" = "Access for your contacts and phones"; - "permission reminders name" = "Reminders"; -"permission reminders description" = "Application can create new task"; - "permission speech name" = "Speech"; -"permission speech description" = "Allow to check your voice"; - "permission motion name" = "Motion"; -"permission motion description" = "Allow to record motion and environment-related data"; - "permission media library name" = "Media Library"; -"permission media library description" = "Allow to check your media"; - "permission bluetooth name" = "Bluetooth"; -"permission bluetooth description" = "Allow access to bluetooth"; - "permission notification name" = "Notification"; -"permission notification description" = "Get important information without opening app."; - "permission location when in use name" = "Location When Use"; -"permission location when in use description" = "Allow to access your location"; - "permission location always name" = "Location Always"; -"permission location always description" = "Allow to access your location"; - "permission tracking name" = "Tracking"; -"permission tracking description" = "Allow to access app-related data"; - "permission faceid name" = "FaceID"; -"permission faceid description" = "Allow using Face ID identity"; - "permission siri name" = "Siri"; -"permission siri description" = "You will be able to use Siri"; - "permission health name" = "Health"; - -"permission health description" = "Allow to access health data"; - -"denied alert title" = "Permission denied"; - -"denied alert description" = "Please, go to Settings and allow permission."; - -"denied alert action" = "Settings"; - -"denied alert cancel" = "Cancel"; - -"action denied" = "Denied"; diff --git a/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings index 18f7aec7..cd78d3e0 100644 --- a/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings @@ -1,90 +1,33 @@ -"action allow" = "Continuar"; - -"action allowed" = "Permitido"; - -"titles header" = "Necesita permiso"; - -"titles sub header" = "Solicitud de permisos"; - -"titles description" = "Estos son los permisos que la aplicación requiere para funcionar correctamente. Consulte la descripción de cada permiso."; - -"titles comment" = "Los permisos son necesarios para que la aplicación funcione y se desempeñe correctamente. Los permisos Push no son necesarios"; - "permission camera name" = "Cámara"; -"permission camera description" = "Permitir que la aplicación utilice la cámara"; - "permission photoLibrary name" = "Biblioteca fotográfica"; -"permission photoLibrary description" = "Acceso para guardar fotos en tu galería"; - "permission microphone name" = "Micrófono"; -"permission microphone description" = "Permitir la grabación de voz desde la aplicación"; - "permission calendar name" = "Calendario"; -"permission calendar description" = "La aplicación puede añadir eventos al calendario"; - "permission contacts name" = "Contactos"; -"permission contacts description" = "Acceso para sus contactos y teléfonos"; - "permission reminders name" = "Recordatorios"; -"permission reminders description" = "La aplicación puede crear una nueva tarea"; - "permission speech name" = "Discurso"; -"permission speech description" = "Permitir comprobar su voz"; - "permission motion name" = "Movimiento"; -"permission motion description" = "Permite registrar datos relacionados con el movimiento y el entorno"; - "permission media library name" = "Biblioteca de medios de comunicación"; -"permission media library description" = "Permitir la comprobación de los medios de comunicación"; - "permission bluetooth name" = "Bluetooth"; -"permission bluetooth description" = "Permitir el acceso al bluetooth"; - "permission notification name" = "Notificación"; -"permission notification description" = "Obtenga información importante sin abrir la aplicación."; - "permission location when in use name" = "Ubicación cuando se usa"; -"permission location when in use description" = "Allow to access your location"; - "permission location always name" = "Ubicación Siempre"; -"permission location always description" = "Permitir el acceso a su ubicación -"; - "permission tracking name" = "Seguimiento de"; -"permission tracking description" = "Permitir el acceso a los datos relacionados con la aplicación"; - "permission faceid name" = "FaceID"; -"permission faceid description" = "Permitir el uso de la identidad de Face ID"; - "permission siri name" = "Siri"; -"permission siri description" = "Podrá utilizar Siri"; - "permission health name" = "Salud"; - -"permission health description" = "Permitir el acceso a los datos de salud"; - -"denied alert title" = "Permiso denegado"; - -"denied alert description" = "Por favor, vaya a Configuración y permita el permiso."; - -"denied alert action" = "Ajustes"; - -"denied alert cancel" = "Cancelar"; - -"action denied" = "Negado"; diff --git a/Sources/PermissionsKit/Resources/Localization/fa.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/fa.lproj/Localizable.strings index ac3330a3..ad487133 100644 --- a/Sources/PermissionsKit/Resources/Localization/fa.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/fa.lproj/Localizable.strings @@ -1,89 +1,33 @@ -"action allow" = "ادامه"; - -"action allowed" = "مجاز"; - -"titles header" = "نیاز به مجوز"; - -"titles sub header" = "درخواست مجوز"; - -"titles description" = "اینها مجوزهایی هستند که برنامه برای درست کار کردن نیاز دارد. لطفاً توضیحات مربوط به هر مجوز را ببینید."; - -"titles comment" = "مجوزها برای کار و عملکرد صحیح برنامه ضروری هستند. اعلانات مجوزهای ضروری نیستند"; - "permission camera name" = "دوربین"; -"permission camera description" = "اجازه دادن به برنامه برای استفاده از دوربین"; - "permission photoLibrary name" = "گالری"; -"permission photoLibrary description" = "دسترسی برای ذخیره عکس ها در گالری"; - "permission microphone name" = "میکروفون"; -"permission microphone description" = "اجازه ضبط صدا به برنامه"; - "permission calendar name" = "تقویم"; -"permission calendar description" = "برنامه می تواند رویدادها را به تقویم اضافه کند"; - "permission contacts name" = "مخاطبین"; -"permission contacts description" = "دسترسی برای مخاطبین و تلفن های شما"; - "permission reminders name" = "یادآوری ها"; -"permission reminders description" = "برنامه می تواند تسک جدیدی ایجاد کند"; - "permission speech name" = "گفتار"; -"permission speech description" = "اجازه ضبط صدای شما"; - "permission motion name" = "حرکت"; -"permission motion description" = "اجازه ضبط حرکت و داده های مربوط به محیط را فراهم می کند"; - "permission media library name" = "مدیا"; -"permission media library description" = "اجازه بررسی مدیا شما"; - "permission bluetooth name" = "بلوتوث"; -"permission bluetooth description" = "اجازه دسترسی به بلوتوث"; - "permission notification name" = "اعلانات"; -"permission notification description" = "اطلاعات مهم را بدون باز کردن برنامه دریافت کنید."; - "permission location when in use name" = "موقعیت مکانی هنگام استفاده"; -"permission location when in use description" = "اجازه دسترسی به موقعیت مکانی شما"; - "permission location always name" = "موقعیت مکانی همیشه"; -"permission location always description" = "اجازه دسترسی به موقعیت مکانی شما"; - "permission tracking name" = "ردیابی"; -"permission tracking description" = "اجازه دسترسی به داده های مربوط به برنامه"; - "permission faceid name" = "FaceID"; -"permission faceid description" = "اجازه استفاده از شناسه Face ID"; - "permission siri name" = "سیری"; -"permission siri description" = "شما می توانید از سیری استفاده کنید"; - "permission health name" = "سلامت"; - -"permission health description" = "اجازه دسترسی به داده های سلامت"; - -"denied alert title" = "مجوز رد شد"; - -"denied alert description" = "لطفاً به تنظیمات بروید و مجوز بدهید."; - -"denied alert action" = "تنظیمات"; - -"denied alert cancel" = "لغو"; - -"action denied" = "رد شد"; diff --git a/Sources/PermissionsKit/Resources/Localization/fr.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/fr.lproj/Localizable.strings index 5e834d09..3a66f72d 100644 --- a/Sources/PermissionsKit/Resources/Localization/fr.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/fr.lproj/Localizable.strings @@ -1,89 +1,33 @@ -"action allow" = "Continuer"; - -"action allowed" = "Autorisé"; - -"titles header" = "Besoin d'une autorisation"; - -"titles sub header" = "Demande de permissions"; - -"titles description" = "Il s'agit des autorisations dont l'application a besoin pour fonctionner correctement. Veuillez consulter la description de chaque autorisation."; - -"titles comment" = "Les permissions sont nécessaires pour que l'application fonctionne et s'exécute correctement. Les permissions ne sont pas nécessaires"; - "permission camera name" = "Caméra"; -"permission camera description" = "Autoriser l'application à utiliser la caméra"; - "permission photoLibrary name" = "Photothèque"; -"permission photoLibrary description" = "Accès pour sauvegarder les photos dans votre galerie"; - "permission microphone name" = "Microphone"; -"permission microphone description" = "Permet d'enregistrer la voix à partir de l'application"; - "permission calendar name" = "Calendrier"; -"permission calendar description" = "L'application peut ajouter des événements au calendrier"; - "permission contacts name" = "Contacts"; -"permission contacts description" = "Accès à vos contacts et téléphones"; - "permission reminders name" = "Rappels"; -"permission reminders description" = "L'application peut créer une nouvelle tâche"; - "permission speech name" = "Voix"; -"permission speech description" = "Permet de vérifier votre voix"; - "permission motion name" = "Mouvement"; -"permission motion description" = "Permet d'enregistrer les mouvements et les données liées à l'environnement"; - "permission media library name" = "Médiathèque"; -"permission media library description" = "Permet de vérifier vos médias"; - "permission bluetooth name" = "Bluetooth"; -"permission bluetooth description" = "Permet d'accéder à Bluetooth"; - "permission notification name" = "Notification"; -"permission notification description" = "Obtenez des informations importantes sans ouvrir l'application."; - "permission location when in use name" = "Localisation lors de l'utilisation"; -"permission location when in use description" = "Autorisez l'accès à votre localisation"; - "permission location always name" = "Localisation Toujours"; -"permission location always description" = "Autorisez l'accès à votre emplacement"; - "permission tracking name" = "Suivi du site"; -"permission tracking description" = "Autoriser l'accès aux données liées à l'application"; - "permission faceid name" = "FaceID"; -"permission faceid description" = "Autoriser l'utilisation de l'identité Face ID"; - "permission siri name" = "Siri"; -"permission siri description" = "Vous pourrez utiliser Siri"; - "permission health name" = "Santé"; - -"permission health description" = "Permettre d'accéder aux données de santé"; - -"denied alert title" = "Permission refusée"; - -"denied alert description" = "Veuillez aller dans Paramètres et autoriser la permission."; - -"denied alert action" = "Paramètres"; - -"denied alert cancel" = "Annuler"; - -"action denied" = "Refusé"; diff --git a/Sources/PermissionsKit/Resources/Localization/it.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/it.lproj/Localizable.strings index 85cea273..3202089f 100644 --- a/Sources/PermissionsKit/Resources/Localization/it.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/it.lproj/Localizable.strings @@ -1,89 +1,33 @@ -"action allow" = "Continua"; - -"action allowed" = "Permesso"; - -"titles header" = "Need Permission"; - -"titles sub header" = "Richiesta permessi"; - -"titles description" = "Questi sono i permessi che l'app richiede per funzionare correttamente. Si prega di vedere la descrizione per ogni permesso"; - -"titles comment" = "I permessi sono necessari affinché l'applicazione funzioni e funzioni correttamente. Spingere non sono permessi richiesti"; - "permission camera name" = "Camera"; -"permission camera description" = "Permetti all'app di usare la fotocamera"; - "permission photoLibrary name" = "Photo Library"; -"permission photoLibrary description" = "Accesso per salvare le foto nella tua galleria"; - "permission microphone name" = "Microphone"; -"permission microphone description" = "Permettere di registrare la voce dall'app"; - "permission calendar name" = "Calendar"; -"permission calendar description" = "L'applicazione può aggiungere eventi al calendario"; - "permission contacts name" = "Contacts"; -"permission contacts description" = "Accesso per i tuoi contatti e telefoni"; - "permission reminders name" = "Reminders"; -"permission reminders description" = "Application can create new task"; - "permission speech name" = "Speech"; -"permission speech description" = "Permetti di controllare la tua voce"; - "permission motion name" = "Motion"; -"permission motion description" = "Allow to record motion and environment-related data"; - "permission media library name" = "Media Library"; -"permission media library description" = "Allow to check your media"; - "permission bluetooth name" = "Bluetooth"; -"permission bluetooth description" = "Permettere l'accesso al bluetooth"; - "permission notification name" = "Notification"; -"permission notification description" = "Ottieni informazioni importanti senza aprire l'app"; - "permission location when in use name" = "Location When Use"; -"permission location when in use description" = "Consenti l'accesso alla tua posizione"; - "permission location always name" = "Posizione sempre"; -"permission location always description" = "Consenti di accedere alla tua posizione"; - "permission tracking name" = "Tracking"; -"permission tracking description" = "Consenti di accedere ai dati relativi all'app"; - "permission faceid name" = "FaceID"; -"permission faceid description" = "Permettere di utilizzare l'identità di Face ID"; - "permission siri name" = "Siri"; -"permission siri description" = "Sarà possibile utilizzare Siri"; - "permission health name" = "Salute"; - -"permission health description" = "Consenti l'accesso ai dati sanitari"; - -"denied alert title" = "Permesso negato"; - -"denied alert description" = "Per favore, vai su Impostazioni e autorizza il permesso"; - -"denied alert action" = "Impostazioni"; - -"denied alert cancel" = "Annulla"; - -"action denied" = "Negato"; diff --git a/Sources/PermissionsKit/Resources/Localization/nl.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/nl.lproj/Localizable.strings index 46e285f4..5c7fb784 100644 --- a/Sources/PermissionsKit/Resources/Localization/nl.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/nl.lproj/Localizable.strings @@ -1,89 +1,33 @@ -"action allow" = "Doorgaan"; - -"action allowed" = "Toegestaan"; - -"titles header" = "Toestemming vereist"; - -"titles sub header" = "Machtigingsverzoek"; - -"titles description" = "Dit zijn de machtigingen die de app nodig heeft om goed te werken. Zie de beschrijving voor elke machtiging."; - -"titles comment" = "Machtigingen zijn nodig om de toepassing correct te laten werken en uit te voeren. Push zijn geen vereiste machtigingen"; - "permission camera name" = "Camera"; -"permission camera description" = "App toestaan ​​voor gebruik camera"; - "permission photoLibrary name" = "Foto Bibliotheek"; -"permission photoLibrary description" = "Toegang om foto's in uw galerij op te slaan"; - "permission microphone name" = "Microfoon"; -"permission microphone description" = "Opname stem vanuit app toestaan"; - "permission calendar name" = "Kalender"; -"permission calendar description" = "Applicatie kan evenementen toevoegen aan kalender"; - "permission contacts name" = "Contacten"; -"permission contacts description" = "Toegang tot uw contacten en telefoonnummers"; - "permission reminders name" = "Herinneringen"; -"permission reminders description" = "Toepassing kan nieuwe taak maken"; - "permission speech name" = "Spraak"; -"permission speech description" = "Sta toe om je stem te controleren"; - "permission motion name" = "Beweging"; -"permission motion description" = "Sta toe om bewegings- en omgevingsgerelateerde gegevens op te nemen"; - "permission media library name" = "Media Bibliotheek"; -"permission media library description" = "Toestaan ​​om uw media te controleren"; - "permission bluetooth name" = "Bluetooth"; -"permission bluetooth description" = "Toegang tot bluetooth toestaan"; - "permission notification name" = "Notificatie"; -"permission notification description" = "Krijg belangrijke informatie zonder de app te openen."; - "permission location when in use name" = "Locatie tijdens gebruik"; -"permission location when in use description" = "Toegang tot uw locatie toestaan"; - "permission location always name" = "Locatie Altijd"; -"permission location always description" = "Toegang tot uw locatie toestaan"; - "permission tracking name" = "Volgen"; -"permission tracking description" = "Toegang geven tot app-gerelateerde gegevens"; - "permission faceid name" = "FaceID"; -"permission faceid description" = "Gebruik van Face ID-identiteit toestaan"; - "permission siri name" = "Siri"; -"permission siri description" = "U kunt Siri gebruiken"; - "permission health name" = "Gezondheid"; - -"permission health description" = "Toegang geven tot gezondheidsgegevens"; - -"denied alert title" = "Toestemming geweigerd"; - -"denied alert description" = "Ga naar Instellingen en geef toestemming."; - -"denied alert action" = "Instellingen"; - -"denied alert cancel" = "Annuleren"; - -"action denied" = "Afgewezen"; diff --git a/Sources/PermissionsKit/Resources/Localization/pl.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/pl.lproj/Localizable.strings index b607ad17..a9711b45 100644 --- a/Sources/PermissionsKit/Resources/Localization/pl.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/pl.lproj/Localizable.strings @@ -1,89 +1,33 @@ -"action allow" = "Kontyntynuj"; - -"action allowed" = "Dozwolone"; - -"titles header" = "Potrzebne zezwolenie"; - -"titles sub header" = "Żądanie uprawnień"; - -"titles description" = "To są uprawnienia, których aplikacja wymaga do poprawnego działania. Proszę zobaczyć opis dla każdego uprawnienia."; - -"titles comment" = "Uprawnienia są niezbędne do prawidłowego działania aplikacji. Push nie są wymagane uprawnienia"; - "permission camera name" = "Kamera"; -"permission camera description" = "Zezwól aplikacji na korzystanie z aparatu"; - "permission photoLibrary name" = "Biblioteka zdjęć"; -"permission photoLibrary description" = "Dostęp do zapisywania zdjęć w galerii"; - "permission microphone name" = "Mikrofon"; -"permission microphone description" = "Umożliwia nagrywanie głosu z aplikacji"; - "permission calendar name" = "Kalendarz"; -"permission calendar description" = "Aplikacja może dodawać wydarzenia do kalendarza"; - "permission contacts name" = "Kontakty"; -"permission contacts description" = "Dostęp do kontaktów i telefonów"; - "permission reminders name" = "Przypomnienia"; -"permission reminders description" = "Aplikacja może tworzyć nowe zadania"; - "permission speech name" = "Mowa"; -"permission speech description" = "Umożliwia sprawdzanie głosu"; - "permission motion name" = "Motion"; -"permission motion description" = "Umożliwia rejestrowanie ruchu i danych związanych z otoczeniem"; - "permission media library name" = "Biblioteka mediów"; -"permission media library description" = "Umożliwia sprawdzanie multimediów."; - "permission bluetooth name" = "Bluetooth"; -"permission bluetooth description" = "Zezwalaj na dostęp do bluetooth"; - "permission notification name" = "Powiadomienia"; -"permission notification description" = "Otrzymuj ważne informacje bez otwierania aplikacji."; - "permission location when in use name" = "Lokalizacja podczas używania"; -"permission location when in use description" = "Zezwól na dostęp do swojej lokalizacji."; - "permission location always name" = "Lokalizacja zawsze"; -"permission location always description" = "Zezwalaj na dostęp do swojej lokalizacji"; - "permission tracking name" = "Śledzenie"; -"permission tracking description" = "Zezwalaj na dostęp do danych związanych z aplikacją"; - "permission faceid name" = "FaceID"; -"permission faceid description" = "Zezwalaj na używanie tożsamości Face ID"; - "permission siri name" = "Siri"; -"permission siri description" = "Będziesz mógł korzystać z Siri"; - "permission health name" = "Zdrowie"; - -"permission health description" = "Zezwalaj na dostęp do danych dotyczących zdrowia"; - -"denied alert title" = "Odmowa pozwolenia"; - -"denied alert description" = "Proszę przejść do Ustawień i zezwolić na dostęp."; - -"denied alert action" = "Ustawienia"; - -"denied alert cancel" = "Anuluj"; - -"action denied" = "Odmówiono"; diff --git a/Sources/PermissionsKit/Resources/Localization/pt.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/pt.lproj/Localizable.strings index 3ed356d5..31757f9c 100644 --- a/Sources/PermissionsKit/Resources/Localization/pt.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/pt.lproj/Localizable.strings @@ -1,89 +1,33 @@ -"action allow" = "Prosseguir"; - -"action allowed" = "Permitido"; - -"titles header" = "Necessidade de Permissão"; - -"titles sub header" = "Pedido de permissões"; - -"titles description" = "Estas são as permissões de que o aplicativo necessita para funcionar correctamente. Por favor, ver descrição de cada permissão."; - -"titles comment" = "As permissões são necessárias para que a aplicação funcione e funcione correctamente. Não são necessárias permissões para a aplicação."; - "permission camera name" = "Câmara"; -"permission camera description" = "Permitir o uso da câmara"; - "permission photoLibrary name" = "Biblioteca de fotos"; -"permission photoLibrary description" = "Acesso para guardar fotos na sua galeria"; - "permission microphone name" = "Microfone"; -"permission microphone description" = "Permitir a gravação de voz da app"; - "permission calendar name" = "Calendário"; -"permission calendar description" = "A aplicação pode adicionar eventos ao calendário"; - "permission contacts name" = "Contactos"; -"permission contacts description" = "Acesso para os seus contactos e telefones"; - "permission reminders name" = "Lembretes"; -"permission reminders description" = "A aplicação pode criar uma nova tarefa"; - "permission speech name" = "Discurso"; -"permission speech description" = "Permita verificar a sua voz"; - "permission motion name" = "Moção"; -"permission motion description" = "Permitir o registo de movimentos e dados relacionados com o ambiente"; - "permission media library name" = "Mediateca"; -"permission media library description" = "Permita verificar os seus meios de comunicação"; - "permission bluetooth name" = "Bluetooth"; -"permission bluetooth description" = "Permitir o acesso ao bluetooth"; - "permission notification name" = "Notificação"; -"permission notification description" = "Obter informações importantes sem abrir a aplicação."; - "permission location when in use name" = "Localização Quando Usar"; -"permission location when in use description" = "Permitir o acesso à sua localização"; - "permission location always name" = "Localização Sempre"; -"permission location always description" = "Permitir o acesso à sua localização"; - "permission tracking name" = "Rastreamento"; -"permission tracking description" = "Permitir o acesso a dados relacionados com as aplicações"; - "permission faceid name" = "FaceID"; -"permission faceid description" = "Permitir a utilização da identidade de identificação facial"; - "permission siri name" = "Siri"; -"permission siri description" = "Poderá utilizar o Siri"; - "permission health name" = "Saúde"; - -"permission health description" = "Permitir o acesso a dados de saúde"; - -"denied alert title" = "Permissão negada"; - -"denied alert description" = "Por favor, vá a Settings e permita a permissão."; - -"denied alert action" = "Definições"; - -"denied alert cancel" = "Cancelar"; - -"action denied" = "Negado"; diff --git a/Sources/PermissionsKit/Resources/Localization/ru.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/ru.lproj/Localizable.strings index 7023c49c..cf060ded 100644 --- a/Sources/PermissionsKit/Resources/Localization/ru.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/ru.lproj/Localizable.strings @@ -1,89 +1,33 @@ -"action allow" = "Разрешить"; - -"action allowed" = "Готово"; - -"titles header" = "Нужны разрешения"; - -"titles sub header" = "Запрос"; - -"titles description" = "Это разрешения, необходимые приложению для правильной работы. Гляньте описание каждого разрешения."; - -"titles comment" = "Разрешения необходимы для работы и правильной работы приложения. Уведомления не обязательны."; - "permission camera name" = "Камера"; -"permission camera description" = "Разрешить доступ приложения к камере."; - "permission photoLibrary name" = "Галерея"; -"permission photoLibrary description" = "Приложение сможет сохранять фото в галерею"; - "permission microphone name" = "Микрофон"; -"permission microphone description" = "Приложение сможет записывать голос"; - "permission calendar name" = "Календарь"; -"permission calendar description" = "Доступ к событиям в календаре"; - "permission contacts name" = "Контакты"; -"permission contacts description" = "Доступ к контактам из телефонной книжки"; - "permission reminders name" = "Напоминания"; -"permission reminders description" = "Приложение сможет создавать и редактировать напоминания"; - "permission speech name" = "Распознавание Речи"; -"permission speech description" = "Приложение сможет анализировать вашу речь"; - "permission motion name" = "Движение"; -"permission motion description" = "Позволяет записывать данные о движении и окружающей среде"; - "permission media library name" = "Медиа библиотека"; -"permission media library description" = "Доступ к вашим медиа"; - "permission bluetooth name" = "Bluetooth"; -"permission bluetooth description" = "Приложение будет иметь доступ к Bluetooth"; - "permission notification name" = "Уведомления"; -"permission notification description" = "Получайте важную информацию, не открывая приложение."; - "permission location when in use name" = "Локация, когда открыто приложение"; -"permission location when in use description" = "Разрешить доступ к вашему местоположению"; - "permission location always name" = "Локация"; -"permission location always description" = "Разрешить доступ к вашему местоположению"; - "permission tracking name" = "Отслеживание"; -"permission tracking description" = "Разрешить отслеживание с помощью рекламного идентификатора"; - "permission faceid name" = "FaceID"; -"permission faceid description" = "Разрешите идентификацию с помощью Face ID"; - -"denied alert title" = "Разрешение заблокировано"; - "permission siri name" = "Siri"; -"permission siri description" = "Вы сможете пользоваться Siri"; - "permission health name" = "Здоровье"; - -"permission health description" = "Разрешить доступ к данным о здоровье"; - -"denied alert description" = "Пожалуйста, перейдите в настройки и измените доступ к разрешению."; - -"denied alert action" = "Открыть Настройки"; - -"denied alert cancel" = "Отменить"; - -"action denied" = "Отклонено"; diff --git a/Sources/PermissionsKit/Resources/Localization/uk.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/uk.lproj/Localizable.strings index 5ede8020..35f5ead5 100644 --- a/Sources/PermissionsKit/Resources/Localization/uk.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/uk.lproj/Localizable.strings @@ -1,89 +1,33 @@ -"action allow" = "Дозвольте"; - -"action allowed" = "Дозволено"; - -"titles header" = "Потрібен дозвіл"; - -"titles sub header" = "Запит на дозвіл"; - -"titles description" = "Це дозволи, які вимагає програма для належної роботи. Будь ласка, див. Опис кожного дозволу."; - -"titles comment" = "Дозволи необхідні для того, щоб програма працювала та працювала правильно. Push не потрібні дозволи"; - "permission camera name" = "Камера"; -"permission camera description" = "Дозволити програмі використовувати камеру"; - "permission photoLibrary name" = "Фототека"; -"permission photoLibrary description" = "Доступ для збереження фотографій у вашій галереї"; - "permission microphone name" = "Мікрофон"; -"permission microphone description" = "Дозволити записувати голос із програми"; - "permission calendar name" = "Календар"; -"permission calendar description" = "Додаток може додавати події до календаря"; - "permission contacts name" = "Контакти"; -"permission contacts description" = "Доступ для ваших контактів і телефонів"; - "permission reminders name" = "Нагадування"; -"permission reminders description" = "Додаток може створити нове завдання"; - "permission speech name" = "Мовлення"; -"permission speech description" = "Дозвольте перевірити свій голос"; - "permission motion name" = "Рух"; -"permission motion description" = "Дозволити записувати дані про рух та навколишнє середовище"; - "permission media library name" = "Медіатека"; -"permission media library description" = "Дозвольте перевірити медіа"; - "permission bluetooth name" = "Bluetooth"; -"permission bluetooth description" = "Дозволити доступ до Bluetooth"; - "permission notification name" = "Повідомлення"; -"permission notification description" = "Отримуйте важливу інформацію, не відкриваючи додаток."; - "permission location when in use name" = "Розташування під час використання"; -"permission location when in use description" = "Дозволити доступ до вашого місцезнаходження"; - "permission location always name" = "Розташування Завжди"; -"permission location always description" = "Дозволити доступ до вашого місцезнаходження"; - "permission tracking name" = "Відстеження"; -"permission tracking description" = "Дозволити доступ до даних, пов’язаних із додатками"; - "permission faceid name" = "FaceID"; -"permission faceid description" = "Дозволити використання ідентифікатора обличчя Face ID"; - -"denied alert title" = "Дозвіл відмовлено"; - "permission siri name" = "Siri"; -"permission siri description" = "Ви зможете користуватися Siri"; - "permission health name" = "Здоров'я"; - -"permission health description" = "Дозволити доступ до даних про стан здоров’я"; - -"denied alert description" = "Перейдіть у Налаштування та надайте дозвіл."; - -"denied alert action" = "Налаштування"; - -"denied alert cancel" = "Скасувати"; - -"action denied" = "Заперечується"; diff --git a/Sources/PermissionsKit/Resources/Localization/zh-Hant.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/zh-Hant.lproj/Localizable.strings index d886a0c2..e9e48f6b 100644 --- a/Sources/PermissionsKit/Resources/Localization/zh-Hant.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/zh-Hant.lproj/Localizable.strings @@ -1,89 +1,33 @@ -"action allow" = "允許"; - -"action allowed" = "已允許"; - -"titles header" = "需要取用權限"; - -"titles sub header" = "要求取用權限"; - -"titles description" = "為了提供完整的服務,App 需要以下取用權限,請參考每個取用權限的說明。"; - -"titles comment" = "App 需要取用權限才能得到最完整的體驗,推播通知不是必須的取用權限。"; - "permission camera name" = "相機"; -"permission camera description" = "允許 App 使用相機"; - "permission photoLibrary name" = "相簿"; -"permission photoLibrary description" = "允許 App 儲存照片到您的相簿"; - "permission microphone name" = "麥克風"; -"permission microphone description" = "允許 App 錄音"; - "permission calendar name" = "日曆"; -"permission calendar description" = "允許 App 新增行程至您的日曆"; - "permission contacts name" = "通訊錄"; -"permission contacts description" = "允許 App 取用您的聯絡人和電話號碼"; - "permission reminders name" = "提醒事項"; -"permission reminders description" = "允許 App 新增提醒事項"; - "permission speech name" = "語音辨識"; -"permission speech description" = "允許 App 分析您的聲音"; - "permission motion name" = "運動"; -"permission motion description" = "允許紀錄運動與相關資料"; - "permission media library name" = "媒體櫃"; -"permission media library description" = "允許取用您的媒體櫃"; - "permission bluetooth name" = "藍芽"; -"permission bluetooth description" = "允許使用藍芽"; - "permission notification name" = "推播通知"; -"permission notification description" = "在不打開 App 的情況下,取得重要通知"; - "permission location when in use name" = "在使用 App 期間取用位置"; -"permission location when in use description" = "取用您的位置"; - "permission location always name" = "總是取用位置"; -"permission location always description" = "取用您的位置"; - "permission tracking name" = "追蹤"; -"permission tracking description" = "允許追蹤您在其他公司的 App 和網站上的活動"; - "permission faceid name" = "FaceID"; -"permission faceid description" = "允許使用 Face ID"; - "permission siri name" = "Siri"; -"permission siri description" = "您將能夠使用 Siri"; - "permission health name" = "健康"; - -"permission health description" = "允許取用健康的資料"; - -"denied alert title" = "已拒絕取用"; - -"denied alert description" = "請前往至「設定」並允許取用"; - -"denied alert action" = "設定"; - -"denied alert cancel" = "取消"; - -"action denied" = "拒絕"; diff --git a/Sources/PermissionsKit/Resources/Localization/zh_Hans.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/zh_Hans.lproj/Localizable.strings index 9d315ab8..6b7b5dc0 100644 --- a/Sources/PermissionsKit/Resources/Localization/zh_Hans.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/zh_Hans.lproj/Localizable.strings @@ -1,89 +1,33 @@ -"action allow" = "允许"; - -"action allowed" = "已允许"; - -"titles header" = "需要授权"; - -"titles sub header" = "授权请求"; - -"titles description" = "为了提供更好的服务, App 需要如下权限. 请参考每个权限的说明."; - -"titles comment" = "App 需要权限才能正常工作和执行. 推送通知不是必需的权限"; - "permission camera name" = "相机"; -"permission camera description" = "允许 App 使用相机"; - "permission photoLibrary name" = "照片图库"; -"permission photoLibrary description" = "允许 App 将照片保存到您的图库"; - "permission microphone name" = "麦克风"; -"permission microphone description" = "允许 App 录制音频"; - "permission calendar name" = "日历"; -"permission calendar description" = "允许 App 添加活动至您的日历"; - "permission contacts name" = "通讯录"; -"permission contacts description" = "允许 App 获取您的联系人以及电话号码"; - "permission reminders name" = "提醒事项"; -"permission reminders description" = "允许 App 创建新的事件"; - "permission speech name" = "语音识别"; -"permission speech description" = "允许 App 分析您的语音"; - "permission motion name" = "运动"; -"permission motion description" = "允许记录运动以及环境相关信息"; - "permission media library name" = "媒体"; -"permission media library description" = "允许访问您的媒体"; - "permission bluetooth name" = "蓝牙"; -"permission bluetooth description" = "允许使用蓝牙"; - "permission notification name" = "通知"; -"permission notification description" = "不打开 App 情况下获取重要通知."; - "permission location when in use name" = "使用 App 期间访问位置"; -"permission location when in use description" = "访问您的位置"; - "permission location always name" = "始终访问位置"; -"permission location always description" = "访问您的位置"; - "permission tracking name" = "跟踪"; -"permission tracking description" = "允许访问 App 相关的数据"; - "permission faceid name" = "FaceID"; -"permission faceid description" = "允许使用Face ID身份"; - "permission siri name" = "Siri"; -"permission siri description" = "你将能够使用Siri"; - "permission health name" = "健康"; - -"permission health description" = "允许访问健康数据"; - -"denied alert title" = "已拒绝授权"; - -"denied alert description" = "请跳转至设置并允许授权"; - -"denied alert action" = "设置"; - -"denied alert cancel" = "取消"; - -"action denied" = "拒绝"; From c8ae8040c433e8386ff773d999512b0065fe7806 Mon Sep 17 00:00:00 2001 From: Moi Gutierrez Date: Fri, 17 Jun 2022 22:41:46 -0300 Subject: [PATCH 02/63] Update Permission.swift added Status: CustomStringConvertible for easy, clear logging. --- Sources/PermissionsKit/Permission.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Sources/PermissionsKit/Permission.swift b/Sources/PermissionsKit/Permission.swift index 5dd28f2b..3f1ca970 100644 --- a/Sources/PermissionsKit/Permission.swift +++ b/Sources/PermissionsKit/Permission.swift @@ -86,12 +86,21 @@ open class Permission: Equatable { // MARK: - Models - @objc public enum Status: Int { + @objc public enum Status: Int, CustomStringConvertible { case authorized case denied case notDetermined case notSupported + + public var description: String { + switch self { + case .authorized: return "authorized" + case .denied: return "denied" + case .notDetermined: return "notDetermined" + case .notSupported: return "notSupported" + } + } } @objc public enum Kind: Int { From c0f9f0c67289f9d6e85f542c63c9d3b6b33bda16 Mon Sep 17 00:00:00 2001 From: Moi Gutierrez Date: Sun, 19 Jun 2022 17:14:59 -0300 Subject: [PATCH 03/63] description update [skip ci] --- Sources/PermissionsKit/Permission.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/PermissionsKit/Permission.swift b/Sources/PermissionsKit/Permission.swift index 3f1ca970..0a5dd8b5 100644 --- a/Sources/PermissionsKit/Permission.swift +++ b/Sources/PermissionsKit/Permission.swift @@ -97,8 +97,8 @@ open class Permission: Equatable { switch self { case .authorized: return "authorized" case .denied: return "denied" - case .notDetermined: return "notDetermined" - case .notSupported: return "notSupported" + case .notDetermined: return "not determined" + case .notSupported: return "not supported" } } } From 01d64ef804ba3e537de17db5eb2c68e9121e1193 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 20 Jun 2022 10:54:43 +0300 Subject: [PATCH 04/63] Update PermissionsKit.podspec --- PermissionsKit.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PermissionsKit.podspec b/PermissionsKit.podspec index e2df6254..4feff118 100644 --- a/PermissionsKit.podspec +++ b/PermissionsKit.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PermissionsKit" - s.version = "9.0.0" + s.version = "9.0.1" s.summary = "Ask permissions with ready-use interface. You can check status permission and if it has been requested before. Support SwiftUI." s.homepage = "https://github.com/sparrowcode/PermissionsKit" s.source = { :git => "https://github.com/sparrowcode/PermissionsKit.git", :tag => s.version } From 899fca6e107753514b073c378d713760ba67be66 Mon Sep 17 00:00:00 2001 From: Romain Sickenberg Date: Mon, 20 Jun 2022 14:37:06 +0200 Subject: [PATCH 05/63] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 678511fd..94068e7e 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,7 @@ Also changed the title for the button. Instead of `allow` now use `continue`. T + Tesla Companion (add the image)

If you use a `PermissionsKit`, add your application via Pull Request. From 865dfb2a17d40a2f499c7109e9020141b44644a4 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 20 Jun 2022 18:32:18 +0300 Subject: [PATCH 06/63] Updated apps. --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 94068e7e..f52ec210 100644 --- a/README.md +++ b/README.md @@ -183,15 +183,15 @@ Also changed the title for the button. Instead of `allow` now use `continue`. T ## Apps Using

- - - - - - - - - Tesla Companion (add the image) + + + + + + + + +

If you use a `PermissionsKit`, add your application via Pull Request. From 956fb7539b454b487932c43b3e71a0d4b2689c9a Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 20 Jun 2022 18:46:51 +0300 Subject: [PATCH 07/63] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f52ec210..d0768c38 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,7 @@ Also changed the title for the button. Instead of `allow` now use `continue`. T

+ From 3cb66415b3a99450890096a2fd6dea0a084e48b1 Mon Sep 17 00:00:00 2001 From: Thomas May Date: Mon, 11 Jul 2022 15:18:04 +0200 Subject: [PATCH 08/63] Localization changes for GErman --- .../Resources/Localization/de.lproj/Localizable.strings | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings index e0673f44..7597c469 100644 --- a/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings @@ -1,6 +1,6 @@ -"action allow" = "Fortsetzen"; +"action allow" = "Erlauben"; -"action allowed" = "Dürfen"; +"action allowed" = "Genehmigt"; "titles header" = "Benötigen Sie die Erlaubnis"; From 5de2df5c574530fb909cc2cca048a2d50808fc53 Mon Sep 17 00:00:00 2001 From: Thomas May Date: Mon, 11 Jul 2022 15:19:54 +0200 Subject: [PATCH 09/63] Update German Localization --- .../Resources/Localization/de.lproj/Localizable.strings | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings index 7597c469..69e5a140 100644 --- a/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings @@ -1,14 +1,14 @@ "action allow" = "Erlauben"; -"action allowed" = "Genehmigt"; +"action allowed" = "Berechtigt"; -"titles header" = "Benötigen Sie die Erlaubnis"; +"titles header" = "Geben Sie die Erlaubnis"; "titles sub header" = "Berechtigungsanfrage"; "titles description" = "Dies sind die Berechtigungen, die die App benötigt, um richtig zu funktionieren. Bitte lesen Sie die Beschreibung für jede Berechtigung."; -"titles comment" = "Berechtigungen sind notwendig, damit die Anwendung funktioniert und korrekt arbeitet. Push sind nicht erforderliche Berechtigungen"; +"titles comment" = "Berechtigungen sind notwendig, damit die Anwendung funktioniert und korrekt arbeitet."; "permission camera name" = "Kamera"; From f8b1345c52ddf430cc435deb76edca0bee172ac7 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Tue, 19 Jul 2022 09:43:11 +0300 Subject: [PATCH 10/63] Update README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index d0768c38..91829dd9 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,6 @@ Universal API for request permission and get its statuses. Available `.authorize ### Community

- - - From f8a7362b41f31828e17f50c17eac3ba91b1171e4 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 25 Jul 2022 10:20:55 +0300 Subject: [PATCH 11/63] Update README.md --- README.md | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 91829dd9..e4995cc8 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,8 @@ You need to add some keys to the `Info.plist` file with descriptions, per Apple' let key = Permission.bluetooth.usageDescriptionKey ``` -Do not use the description as the name of the key. +> **Warning** +> Do not use the description as the name of the key. ### Localisation @@ -163,20 +164,6 @@ If you use xliff localization export, keys will be create automatically. If you "NSCameraUsageDescription" = "Here description of usage camera"; ``` -## Apple Review - -Apple changed its review guidelines in June 2021. When requesting permissions, apps should require users to always request and make a decision whether to allow or decline the permission. For this reason, the close button in `PermissionsKit` is hidden by default. If you want to force show the close button, run the following code: - -```swift -// Show & hide close button -controller.showCloseButton = true - -// Enable or Disable drag intercation -controller.allowSwipeDismiss = true -``` - -Also changed the title for the button. Instead of `allow` now use `continue`. The Apple Review Team asked for this. For details, check out [this issue](https://github.com/sparrowcode/PermissionsKit/issues/229). - ## Apps Using

From 00c0f538c02171658634f0b3a749461a042cd5e3 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 25 Jul 2022 10:23:59 +0300 Subject: [PATCH 12/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e4995cc8..f8701e0b 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Universal API for request permission and get its statuses. Available `.authorize ## Installation -Ready to use on iOS 11+. Supports iOS, tvOS, and `SwiftUI`. +Ready to use on iOS 11+. Supports iOS, tvOS and `SwiftUI`. ### Swift Package Manager From 976d46ddf8e6a30118ad278abc9c4f936c919ce4 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 25 Jul 2022 10:25:54 +0300 Subject: [PATCH 13/63] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index f8701e0b..4acc46ec 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,6 @@ Universal API for request permission and get its statuses. Available `.authorize - [Status Permission](#status-permission) - [Keys in Info.plist](#keys-in-infoplist) - [Localisations](#localisation) -- [Apple Review](#apple-review) - [Apps Using](#apps-using) ### Permissions From 62c78d72a8940a46e59594ed3141905ceeceaaa2 Mon Sep 17 00:00:00 2001 From: duyhungtnn Date: Fri, 26 Aug 2022 20:44:03 +0700 Subject: [PATCH 14/63] fix : can not use TrackingPermission iOS 14 --- Sources/TrackingPermission/TrackingPermission.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/TrackingPermission/TrackingPermission.swift b/Sources/TrackingPermission/TrackingPermission.swift index 29acd813..c88bc0f3 100644 --- a/Sources/TrackingPermission/TrackingPermission.swift +++ b/Sources/TrackingPermission/TrackingPermission.swift @@ -26,7 +26,7 @@ import PermissionsKit #if PERMISSIONSKIT_TRACKING import AppTrackingTransparency -@available(iOS 14.5, tvOS 14.5, *) +@available(iOS 14, tvOS 14, *) public extension Permission { static var tracking: TrackingPermission { @@ -34,7 +34,7 @@ public extension Permission { } } -@available(iOS 14.5, tvOS 14.5, *) +@available(iOS 14, tvOS 14, *) public class TrackingPermission: Permission { open override var kind: Permission.Kind { .tracking } From acfed9427315510dd2b79935eee20647149abc64 Mon Sep 17 00:00:00 2001 From: Thomas M Date: Thu, 27 Oct 2022 16:29:48 +0200 Subject: [PATCH 15/63] Update Localizable.strings Fix German texts --- .../Resources/Localization/de.lproj/Localizable.strings | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings index 69e5a140..156e6fc6 100644 --- a/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings @@ -6,13 +6,13 @@ "titles sub header" = "Berechtigungsanfrage"; -"titles description" = "Dies sind die Berechtigungen, die die App benötigt, um richtig zu funktionieren. Bitte lesen Sie die Beschreibung für jede Berechtigung."; +"titles description" = "Dies sind die Berechtigungen, die die App benötigt, um korrekt zu funktionieren. Bitte lesen Sie die Beschreibung für jede Berechtigung."; "titles comment" = "Berechtigungen sind notwendig, damit die Anwendung funktioniert und korrekt arbeitet."; "permission camera name" = "Kamera"; -"permission camera description" = "App zur Verwendung der Kamera zulassen"; +"permission camera description" = "Zugriff auf die Kamera gewähren"; "permission photoLibrary name" = "Foto-Bibliothek"; @@ -30,7 +30,7 @@ "permission contacts description" = "Zugriff für Ihre Kontakte und Telefone"; -"permission reminders name" = "Mahnungen"; +"permission reminders name" = "Erinnerungen"; "permission reminders description" = "Anwendung kann neue Aufgabe erstellen"; @@ -68,7 +68,7 @@ "permission faceid name" = "FaceID"; -"permission faceid description" = "Erlauben Sie die Verwendung der Face ID-Identität"; +"permission faceid description" = "Erlauben Sie die Verwendung von FaceID"; "permission siri name" = "Siri"; From 409deeb9be1b599a3fc6f67641e0c0b3f0baf849 Mon Sep 17 00:00:00 2001 From: dDomovoj Date: Mon, 7 Nov 2022 12:53:34 +0100 Subject: [PATCH 16/63] [add] ios 14+ location authorization check delegate method --- .../LocationAlwaysPermission/LocationAlwaysHandler.swift | 8 ++++++++ .../LocationWhenInUseHandler.swift | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/Sources/LocationAlwaysPermission/LocationAlwaysHandler.swift b/Sources/LocationAlwaysPermission/LocationAlwaysHandler.swift index 89740b2e..0b9a59a7 100644 --- a/Sources/LocationAlwaysPermission/LocationAlwaysHandler.swift +++ b/Sources/LocationAlwaysPermission/LocationAlwaysHandler.swift @@ -40,6 +40,14 @@ class LocationAlwaysHandler: NSObject, CLLocationManagerDelegate { } completionHandler() } + + @available(iOS 14.0, *) + func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) { + if manager.authorizationStatus == .notDetermined { + return + } + completionHandler() + } // MARK: - Process diff --git a/Sources/LocationWhenInUsePermission/LocationWhenInUseHandler.swift b/Sources/LocationWhenInUsePermission/LocationWhenInUseHandler.swift index 6a0a6526..029b0dde 100644 --- a/Sources/LocationWhenInUsePermission/LocationWhenInUseHandler.swift +++ b/Sources/LocationWhenInUsePermission/LocationWhenInUseHandler.swift @@ -40,6 +40,14 @@ class LocationWhenInUseHandler: NSObject, CLLocationManagerDelegate { } completionHandler() } + + @available(iOS 14.0, *) + func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) { + if manager.authorizationStatus == .notDetermined { + return + } + completionHandler() + } // MARK: - Process From 5ae0ccf39e166b7a8e089bfc9cf16073a807d4ca Mon Sep 17 00:00:00 2001 From: Hassan Taleb <49780321+HassanTaleb90@users.noreply.github.com> Date: Wed, 5 Apr 2023 13:16:26 +0300 Subject: [PATCH 17/63] Add my App --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4acc46ec..8ed770c3 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,7 @@ If you use xliff localization export, keys will be create automatically. If you +

If you use a `PermissionsKit`, add your application via Pull Request. From 45f049671602f796c6dbcb95ff8d3d7bd3cd39f1 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 10 Apr 2023 14:44:13 +0300 Subject: [PATCH 18/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ed770c3..52d87321 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,7 @@ If you use xliff localization export, keys will be create automatically. If you - +

If you use a `PermissionsKit`, add your application via Pull Request. From 3c6689105ca21fd65e16c50ebebf54dc582fb82a Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 10 Apr 2023 14:50:13 +0300 Subject: [PATCH 19/63] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 52d87321..f52dce9e 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,11 @@ Universal API for request permission and get its statuses. Available `.authorize ### Community

- - + + - - + +

@@ -87,7 +87,7 @@ dependencies: [ ] ``` -Next, choose the permissions you need. But don't add all of them, because apple [will reject app](#apple-review). +Next, choose the permissions you need. But don't add all of them, because apple will reject app. ### CocoaPods: From b0261b317b6bcdb965c7d52fb696acc2003cc673 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 10 Apr 2023 15:01:04 +0300 Subject: [PATCH 20/63] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f52dce9e..88e5c7cc 100644 --- a/README.md +++ b/README.md @@ -73,13 +73,14 @@ Ready to use on iOS 11+. Supports iOS, tvOS and `SwiftUI`. ### Swift Package Manager -In Xcode go to `File` -> `Packages` -> `Update to Latest Package Versions` and insert url: +In Xcode go to Project -> Your Project Name -> `Package Dependencies` -> Tap *Plus*. Insert url: ``` https://github.com/sparrowcode/PermissionsKit ``` -or adding it to the `dependencies` value of your `Package.swift`: +Next, choose the permissions you need. But don't add all of them, because apple will reject app. +Or adding it to the `dependencies` of your `Package.swift`: ```swift dependencies: [ @@ -87,7 +88,7 @@ dependencies: [ ] ``` -Next, choose the permissions you need. But don't add all of them, because apple will reject app. +and choose valid targets. ### CocoaPods: From a295bf3acd7b0908e355f483d438a29beac29fab Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 10 Apr 2023 15:03:30 +0300 Subject: [PATCH 21/63] Updated github assets. --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 0350fe30..9f2e97fd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -3,5 +3,5 @@ name: Bug report about: Create a report to help us improve title: '' labels: bug -assignees: ivanvorobei, svyatoynick +assignees: ivanvorobei --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 3a1bfa7f..6efc6264 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -3,5 +3,5 @@ name: Feature request about: Suggest an idea for this project title: '' labels: enhancement -assignees: ivanvorobei, svyatoynick +assignees: ivanvorobei --- From b2e44184de196dee036c3dff3a8736d02817b98d Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 10 Apr 2023 15:05:53 +0300 Subject: [PATCH 22/63] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index a0468ede..a127164c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Sparrow Code +Copyright (c) 2023 Sparrow Code Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 6e66f7b45aa4550cafa8210f0af506a299a9e4c0 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 10 Apr 2023 19:04:53 +0300 Subject: [PATCH 23/63] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 88e5c7cc..67fcce31 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,12 @@ Universal API for request permission and get its statuses. Available `.authorize + + + + + + From b1b28a5e1b8bf3d3edbdd8b92be8ef1ca902d3c9 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 10 Apr 2023 19:06:18 +0300 Subject: [PATCH 24/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67fcce31..9f70d05a 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Universal API for request permission and get its statuses. Available `.authorize - + From 0bd479b350a40622d864699cd696112772e75e0a Mon Sep 17 00:00:00 2001 From: Peter Viszt Date: Mon, 17 Apr 2023 18:51:15 +0200 Subject: [PATCH 25/63] Fix build warning Non-'@objc' instance method in extensions cannot be overridden; use 'public' instead --- Sources/LocationExtension/LocationAccuracy.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/LocationExtension/LocationAccuracy.swift b/Sources/LocationExtension/LocationAccuracy.swift index db765f94..1a63ba18 100644 --- a/Sources/LocationExtension/LocationAccuracy.swift +++ b/Sources/LocationExtension/LocationAccuracy.swift @@ -24,7 +24,7 @@ import MapKit extension CLLocationManager { - open func setAccuracy(_ value: LocationAccuracy) { + public func setAccuracy(_ value: LocationAccuracy) { desiredAccuracy = value.coreLocationAccuracy } } From c2fb76c9e49308941d74640da5ae726a7a1cff26 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Wed, 19 Apr 2023 20:23:30 +0300 Subject: [PATCH 26/63] Update PermissionsKit.podspec --- PermissionsKit.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PermissionsKit.podspec b/PermissionsKit.podspec index 4feff118..54362ee6 100644 --- a/PermissionsKit.podspec +++ b/PermissionsKit.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PermissionsKit" - s.version = "9.0.1" + s.version = "9.0.4" s.summary = "Ask permissions with ready-use interface. You can check status permission and if it has been requested before. Support SwiftUI." s.homepage = "https://github.com/sparrowcode/PermissionsKit" s.source = { :git => "https://github.com/sparrowcode/PermissionsKit.git", :tag => s.version } From 472faf328b6c42e9aee329c4b59cb91d0965d345 Mon Sep 17 00:00:00 2001 From: parogc <46477273+parogc@users.noreply.github.com> Date: Fri, 28 Apr 2023 13:00:54 +0200 Subject: [PATCH 27/63] Ammend spanish translations I adapted this translations to use the same strings as the iOS settings app --- .../Localization/es.lproj/Localizable.strings | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings index cd78d3e0..130b39c2 100644 --- a/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings +++ b/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings @@ -1,6 +1,6 @@ "permission camera name" = "Cámara"; -"permission photoLibrary name" = "Biblioteca fotográfica"; +"permission photoLibrary name" = "Fotos"; "permission microphone name" = "Micrófono"; @@ -14,19 +14,19 @@ "permission motion name" = "Movimiento"; -"permission media library name" = "Biblioteca de medios de comunicación"; +"permission media library name" = "Contenidos y Apple music"; "permission bluetooth name" = "Bluetooth"; -"permission notification name" = "Notificación"; +"permission notification name" = "Notificaciones"; -"permission location when in use name" = "Ubicación cuando se usa"; +"permission location when in use name" = "Al usar la app"; -"permission location always name" = "Ubicación Siempre"; +"permission location always name" = "Siempre"; -"permission tracking name" = "Seguimiento de"; +"permission tracking name" = "Rastreo"; -"permission faceid name" = "FaceID"; +"permission faceid name" = "Face ID"; "permission siri name" = "Siri"; From c7aeb36936e00579def9dd3cdb38579fb6daed4a Mon Sep 17 00:00:00 2001 From: juanillo62gm Date: Mon, 18 Sep 2023 16:29:14 +0200 Subject: [PATCH 28/63] feat(app): scooter tools --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9f70d05a..ae39eb5b 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,7 @@ If you use xliff localization export, keys will be create automatically. If you +

If you use a `PermissionsKit`, add your application via Pull Request. From 76d1b07e25b988165bc688fb7547b5c6d90c5f27 Mon Sep 17 00:00:00 2001 From: Alexander Puchta Date: Tue, 26 Sep 2023 17:50:40 +0200 Subject: [PATCH 29/63] camera and reminder usage with iOS 17 --- .../CalendarPermission.swift | 23 +++++++++++++++---- .../RemindersPermission.swift | 22 ++++++++++++++---- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/Sources/CalendarPermission/CalendarPermission.swift b/Sources/CalendarPermission/CalendarPermission.swift index cf5efc3b..b1ed34ad 100644 --- a/Sources/CalendarPermission/CalendarPermission.swift +++ b/Sources/CalendarPermission/CalendarPermission.swift @@ -38,25 +38,38 @@ public class CalendarPermission: Permission { open override var kind: Permission.Kind { .calendar } open var usageDescriptionKey: String? { "NSCalendarsUsageDescription" } + open var usageFullAccessDescriptionKey: String? { "NSCalendarsFullAccessUsageDescription" } + open var usageWriteOnlyAccessDescriptionKey: String? { "NSCalendarsWriteOnlyAccessUsageDescription" } public override var status: Permission.Status { switch EKEventStore.authorizationStatus(for: EKEntityType.event) { case .authorized: return .authorized case .denied: return .denied + case .fullAccess: return .authorized case .notDetermined: return .notDetermined case .restricted: return .denied + case .writeOnly: return .authorized @unknown default: return .denied } } public override func request(completion: @escaping () -> Void) { + let eventStore = EKEventStore() - eventStore.requestAccess(to: EKEntityType.event, completion: { - (accessGranted: Bool, error: Error?) in - DispatchQueue.main.async { - completion() + + if #available(iOS 17.0, *) { + eventStore.requestFullAccessToEvents { (accessGranted: Bool, error: Error?) in + DispatchQueue.main.async { + completion() + } } - }) + } else { + eventStore.requestAccess(to: EKEntityType.event) { (accessGranted: Bool, error: Error?) in + DispatchQueue.main.async { + completion() + } + } + } } } #endif diff --git a/Sources/RemindersPermission/RemindersPermission.swift b/Sources/RemindersPermission/RemindersPermission.swift index bd04c4ef..77ab7716 100644 --- a/Sources/RemindersPermission/RemindersPermission.swift +++ b/Sources/RemindersPermission/RemindersPermission.swift @@ -38,25 +38,37 @@ public class RemindersPermission: Permission { open override var kind: Permission.Kind { .reminders } open var usageDescriptionKey: String? { "NSRemindersUsageDescription" } + open var usageFullAccessDescriptionKey: String? { "NSRemindersFullAccessUsageDescription" } public override var status: Permission.Status { switch EKEventStore.authorizationStatus(for: EKEntityType.reminder) { case .authorized: return .authorized case .denied: return .denied + case .fullAccess: return .authorized case .notDetermined: return .notDetermined case .restricted: return .denied + case .writeOnly: return .authorized @unknown default: return .denied } } public override func request(completion: @escaping () -> Void) { + let eventStore = EKEventStore() - eventStore.requestAccess(to: EKEntityType.reminder, completion: { - (accessGranted: Bool, error: Error?) in - DispatchQueue.main.async { - completion() + + if #available(iOS 17.0, *) { + eventStore.requestFullAccessToReminders { (accessGranted: Bool, error: Error?) in + DispatchQueue.main.async { + completion() + } } - }) + } else { + eventStore.requestAccess(to: EKEntityType.reminder) { (accessGranted: Bool, error: Error?) in + DispatchQueue.main.async { + completion() + } + } + } } } #endif From 909010fb8b7766f526a1e0061f69dc7e2d33962d Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Tue, 26 Sep 2023 22:04:03 +0300 Subject: [PATCH 30/63] Fixed readme and version. --- PermissionsKit.podspec | 2 +- README.md | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/PermissionsKit.podspec b/PermissionsKit.podspec index 54362ee6..de49da68 100644 --- a/PermissionsKit.podspec +++ b/PermissionsKit.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PermissionsKit" - s.version = "9.0.4" + s.version = "9.1.0" s.summary = "Ask permissions with ready-use interface. You can check status permission and if it has been requested before. Support SwiftUI." s.homepage = "https://github.com/sparrowcode/PermissionsKit" s.source = { :git => "https://github.com/sparrowcode/PermissionsKit.git", :tag => s.version } diff --git a/README.md b/README.md index ae39eb5b..f7401694 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,6 @@ Universal API for request permission and get its statuses. Available `.authorize - - - From e2bf80f76c817c7732d65bbfe672d90b42fd4091 Mon Sep 17 00:00:00 2001 From: Alexander Puchta Date: Tue, 26 Sep 2023 22:13:41 +0200 Subject: [PATCH 31/63] Add writeOnly type for calendar --- .../CalendarPermission.swift | 32 +++++++++++++++---- Sources/PermissionsKit/Data/Text.swift | 3 +- Sources/PermissionsKit/Permission.swift | 10 +++--- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/Sources/CalendarPermission/CalendarPermission.swift b/Sources/CalendarPermission/CalendarPermission.swift index b1ed34ad..e6e70564 100644 --- a/Sources/CalendarPermission/CalendarPermission.swift +++ b/Sources/CalendarPermission/CalendarPermission.swift @@ -28,15 +28,27 @@ import Foundation import EventKit public extension Permission { - + static var calendar: CalendarPermission { - return CalendarPermission() + return CalendarPermission(kind: .calendar) + } + + static var calendarWriteOnly: CalendarPermission { + return CalendarPermission(kind: .calendarWriteOnly) } } public class CalendarPermission: Permission { - open override var kind: Permission.Kind { .calendar } + private var _kind: Permission.Kind + + // MARK: - Init + + init(kind: Permission.Kind) { + self._kind = kind + } + + open override var kind: Permission.Kind { self._kind } open var usageDescriptionKey: String? { "NSCalendarsUsageDescription" } open var usageFullAccessDescriptionKey: String? { "NSCalendarsFullAccessUsageDescription" } open var usageWriteOnlyAccessDescriptionKey: String? { "NSCalendarsWriteOnlyAccessUsageDescription" } @@ -58,9 +70,17 @@ public class CalendarPermission: Permission { let eventStore = EKEventStore() if #available(iOS 17.0, *) { - eventStore.requestFullAccessToEvents { (accessGranted: Bool, error: Error?) in - DispatchQueue.main.async { - completion() + if self._kind == .calendarWriteOnly { + eventStore.requestWriteOnlyAccessToEvents { (accessGranted: Bool, error: Error?) in + DispatchQueue.main.async { + completion() + } + } + } else { + eventStore.requestFullAccessToEvents { (accessGranted: Bool, error: Error?) in + DispatchQueue.main.async { + completion() + } } } } else { diff --git a/Sources/PermissionsKit/Data/Text.swift b/Sources/PermissionsKit/Data/Text.swift index 9175c2ed..7f960d30 100644 --- a/Sources/PermissionsKit/Data/Text.swift +++ b/Sources/PermissionsKit/Data/Text.swift @@ -31,7 +31,8 @@ enum Texts { return NSLocalizedString("permission photoLibrary name", bundle: bundle, comment: "") case .microphone: return NSLocalizedString("permission microphone name", bundle: bundle, comment: "") - case .calendar: + case .calendar, + .calendarWriteOnly: return NSLocalizedString("permission calendar name", bundle: bundle, comment: "") case .contacts: return NSLocalizedString("permission contacts name", bundle: bundle, comment: "") diff --git a/Sources/PermissionsKit/Permission.swift b/Sources/PermissionsKit/Permission.swift index 0a5dd8b5..8f2f5c09 100644 --- a/Sources/PermissionsKit/Permission.swift +++ b/Sources/PermissionsKit/Permission.swift @@ -110,9 +110,10 @@ open class Permission: Equatable { case photoLibrary = 1 case microphone = 3 case calendar = 4 - case contacts = 5 - case reminders = 6 - case speech = 7 + case calendarWriteOnly = 5 + case contacts = 6 + case reminders = 7 + case speech = 8 case locationWhenInUse = 9 case locationAlways = 10 case motion = 11 @@ -131,7 +132,8 @@ open class Permission: Equatable { return "Photo Library" case .microphone: return "Microphone" - case .calendar: + case .calendar, + .calendarWriteOnly: return "Calendar" case .contacts: return "Contacts" From 1d52e607ab3b17dd39e5e7caf900f13df4b0ac24 Mon Sep 17 00:00:00 2001 From: Alexander Puchta Date: Wed, 27 Sep 2023 11:50:52 +0200 Subject: [PATCH 32/63] Update README.md and added available iOS 17 check for writeOnly permission --- README.md | 4 ++-- Sources/CalendarPermission/CalendarPermission.swift | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9f70d05a..d8be282d 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Universal API for request permission and get its statuses. Available `.authorize | Icon | Permission | Key for `Info.plist` | Get Status | Make Request | | :--: | :---------- | :------------------- | :--------: | :----------: | | | Bluetooth | NSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription | ✅ | ✅ | -| | Calendar | NSCalendarsUsageDescription | ✅ | ✅ | +| | Calendar | NSCalendarsUsageDescription, NSCalendarsFullAccessUsageDescription, NSCalendarsWriteOnlyAccessUsageDescription | ✅ | ✅ | | | Camera | NSCameraUsageDescription | ✅ | ✅ | | | Contacts | NSContactsUsageDescription | ✅ | ✅ | | | FaceID | NSFaceIDUsageDescription | ✅ | ✅ | @@ -68,7 +68,7 @@ Universal API for request permission and get its statuses. Available `.authorize | | Motion | NSMotionUsageDescription | ✅ | ✅ | | | Notification | | ✅ | ✅ | | | Photo Library | NSPhotoLibraryUsageDescription, NSPhotoLibraryAddUsageDescription | ✅ | ✅ | -| | Reminders | NSRemindersUsageDescription | ✅ | ✅ | +| | Reminders | NSRemindersUsageDescription, NSRemindersFullAccessUsageDescription | ✅ | ✅ | | | Siri | NSSiriUsageDescription | ✅ | ✅ | | | Speech Recognizer | NSSpeechRecognitionUsageDescription | ✅ | ✅ | | | Tracking | NSUserTrackingUsageDescription | ✅ | ✅ | diff --git a/Sources/CalendarPermission/CalendarPermission.swift b/Sources/CalendarPermission/CalendarPermission.swift index e6e70564..0fe87056 100644 --- a/Sources/CalendarPermission/CalendarPermission.swift +++ b/Sources/CalendarPermission/CalendarPermission.swift @@ -32,6 +32,10 @@ public extension Permission { static var calendar: CalendarPermission { return CalendarPermission(kind: .calendar) } +} + +@available(iOS 17.0, *) +public extension Permission { static var calendarWriteOnly: CalendarPermission { return CalendarPermission(kind: .calendarWriteOnly) From 6d13eb81fa60733ca37f46aba080a1ee5bc007ee Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Wed, 27 Sep 2023 17:51:17 +0300 Subject: [PATCH 33/63] Clean requests permission with sub-access levels. --- .../CalendarPermission.swift | 61 ++++++++++++++++--- Sources/PermissionsKit/Data/Text.swift | 3 +- Sources/PermissionsKit/Permission.swift | 53 ++++++++-------- 3 files changed, 80 insertions(+), 37 deletions(-) diff --git a/Sources/CalendarPermission/CalendarPermission.swift b/Sources/CalendarPermission/CalendarPermission.swift index 0fe87056..a474cca0 100644 --- a/Sources/CalendarPermission/CalendarPermission.swift +++ b/Sources/CalendarPermission/CalendarPermission.swift @@ -30,7 +30,7 @@ import EventKit public extension Permission { static var calendar: CalendarPermission { - return CalendarPermission(kind: .calendar) + return CalendarPermission(kind: .calendar(access: .full)) } } @@ -38,7 +38,7 @@ public extension Permission { public extension Permission { static var calendarWriteOnly: CalendarPermission { - return CalendarPermission(kind: .calendarWriteOnly) + return CalendarPermission(kind: .calendar(access: .write)) } } @@ -53,9 +53,23 @@ public class CalendarPermission: Permission { } open override var kind: Permission.Kind { self._kind } - open var usageDescriptionKey: String? { "NSCalendarsUsageDescription" } - open var usageFullAccessDescriptionKey: String? { "NSCalendarsFullAccessUsageDescription" } - open var usageWriteOnlyAccessDescriptionKey: String? { "NSCalendarsWriteOnlyAccessUsageDescription" } + open var usageDescriptionKey: String? { + if #available(iOS 17, *) { + switch kind { + case .calendar(let access): + switch access { + case .full: + return "NSCalendarsFullAccessUsageDescription" + case .write: + return "NSCalendarsWriteOnlyAccessUsageDescription" + } + default: + fatalError() + } + } else { + return "NSCalendarsUsageDescription" + } + } public override var status: Permission.Status { switch EKEventStore.authorizationStatus(for: EKEntityType.event) { @@ -64,7 +78,22 @@ public class CalendarPermission: Permission { case .fullAccess: return .authorized case .notDetermined: return .notDetermined case .restricted: return .denied - case .writeOnly: return .authorized + case .writeOnly: + if #available(iOS 17, *) { + switch kind { + case .calendar(let access): + switch access { + case .full: + return .denied + case .write: + return .authorized + } + default: + fatalError() + } + } else { + return .authorized + } @unknown default: return .denied } } @@ -74,19 +103,33 @@ public class CalendarPermission: Permission { let eventStore = EKEventStore() if #available(iOS 17.0, *) { - if self._kind == .calendarWriteOnly { + + let requestWriteOnly = { eventStore.requestWriteOnlyAccessToEvents { (accessGranted: Bool, error: Error?) in DispatchQueue.main.async { completion() } } - } else { - eventStore.requestFullAccessToEvents { (accessGranted: Bool, error: Error?) in + } + + let requestFull = { + eventStore.requestWriteOnlyAccessToEvents { (accessGranted: Bool, error: Error?) in DispatchQueue.main.async { completion() } } } + + switch kind { + case .calendar(let access): + if access == .write { + requestWriteOnly() + } else { + requestFull() + } + default: + requestFull() + } } else { eventStore.requestAccess(to: EKEntityType.event) { (accessGranted: Bool, error: Error?) in DispatchQueue.main.async { diff --git a/Sources/PermissionsKit/Data/Text.swift b/Sources/PermissionsKit/Data/Text.swift index 7f960d30..53ba712a 100644 --- a/Sources/PermissionsKit/Data/Text.swift +++ b/Sources/PermissionsKit/Data/Text.swift @@ -31,8 +31,7 @@ enum Texts { return NSLocalizedString("permission photoLibrary name", bundle: bundle, comment: "") case .microphone: return NSLocalizedString("permission microphone name", bundle: bundle, comment: "") - case .calendar, - .calendarWriteOnly: + case .calendar(access: .full), .calendar(access: .write): return NSLocalizedString("permission calendar name", bundle: bundle, comment: "") case .contacts: return NSLocalizedString("permission contacts name", bundle: bundle, comment: "") diff --git a/Sources/PermissionsKit/Permission.swift b/Sources/PermissionsKit/Permission.swift index 8f2f5c09..851c67a1 100644 --- a/Sources/PermissionsKit/Permission.swift +++ b/Sources/PermissionsKit/Permission.swift @@ -21,7 +21,7 @@ import UIKit -open class Permission: Equatable { +open class Permission { open var authorized: Bool { return status == .authorized @@ -78,10 +78,6 @@ open class Permission: Equatable { // MARK: Internal - public static func == (lhs: Permission, rhs: Permission) -> Bool { - return lhs.kind == rhs.kind - } - public init() {} // MARK: - Models @@ -103,26 +99,26 @@ open class Permission: Equatable { } } - @objc public enum Kind: Int { + public enum Kind { - case camera = 0 - case notification = 2 - case photoLibrary = 1 - case microphone = 3 - case calendar = 4 - case calendarWriteOnly = 5 - case contacts = 6 - case reminders = 7 - case speech = 8 - case locationWhenInUse = 9 - case locationAlways = 10 - case motion = 11 - case mediaLibrary = 12 - case bluetooth = 13 - case tracking = 14 - case faceID = 15 - case siri = 16 - case health = 17 + case camera + case notification + case photoLibrary + case microphone + case calendar(access: CalendarAccess) + case contacts + case reminders + case speech + // Upgrade location as calendar style + case locationWhenInUse + case locationAlways + case motion + case mediaLibrary + case bluetooth + case tracking + case faceID + case siri + case health public var name: String { switch self { @@ -132,8 +128,7 @@ open class Permission: Equatable { return "Photo Library" case .microphone: return "Microphone" - case .calendar, - .calendarWriteOnly: + case .calendar(access: .write), .calendar(access: .full): return "Calendar" case .contacts: return "Contacts" @@ -164,4 +159,10 @@ open class Permission: Equatable { } } } + + public enum CalendarAccess { + + case full + case write + } } From 6c4136dcb4891bc15e2dac8a906fbd6878e60b75 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Wed, 27 Sep 2023 17:57:23 +0300 Subject: [PATCH 34/63] Updated asking permission for calendar. --- Sources/CalendarPermission/CalendarPermission.swift | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Sources/CalendarPermission/CalendarPermission.swift b/Sources/CalendarPermission/CalendarPermission.swift index a474cca0..4efccbb5 100644 --- a/Sources/CalendarPermission/CalendarPermission.swift +++ b/Sources/CalendarPermission/CalendarPermission.swift @@ -29,16 +29,8 @@ import EventKit public extension Permission { - static var calendar: CalendarPermission { - return CalendarPermission(kind: .calendar(access: .full)) - } -} - -@available(iOS 17.0, *) -public extension Permission { - - static var calendarWriteOnly: CalendarPermission { - return CalendarPermission(kind: .calendar(access: .write)) + static func calendar(access: CalendarAccess) -> CalendarPermission { + CalendarPermission(kind: .calendar(access: access)) } } From 36c972762720d5e2d7b276abba34349c605aae62 Mon Sep 17 00:00:00 2001 From: ostatnicky Date: Thu, 28 Sep 2023 10:56:47 +0200 Subject: [PATCH 35/63] Update PermissionsKit.podspec --- PermissionsKit.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PermissionsKit.podspec b/PermissionsKit.podspec index de49da68..096a3dd9 100644 --- a/PermissionsKit.podspec +++ b/PermissionsKit.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PermissionsKit" - s.version = "9.1.0" + s.version = "9.2.0" s.summary = "Ask permissions with ready-use interface. You can check status permission and if it has been requested before. Support SwiftUI." s.homepage = "https://github.com/sparrowcode/PermissionsKit" s.source = { :git => "https://github.com/sparrowcode/PermissionsKit.git", :tag => s.version } From 8356098ba3d6d4c3e03f70deed4ee35362200a66 Mon Sep 17 00:00:00 2001 From: ostatnicky Date: Thu, 28 Sep 2023 10:59:03 +0200 Subject: [PATCH 36/63] Fix full access request to Calendar --- Sources/CalendarPermission/CalendarPermission.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/CalendarPermission/CalendarPermission.swift b/Sources/CalendarPermission/CalendarPermission.swift index 4efccbb5..8cf8f349 100644 --- a/Sources/CalendarPermission/CalendarPermission.swift +++ b/Sources/CalendarPermission/CalendarPermission.swift @@ -105,7 +105,7 @@ public class CalendarPermission: Permission { } let requestFull = { - eventStore.requestWriteOnlyAccessToEvents { (accessGranted: Bool, error: Error?) in + eventStore.requestFullAccessToEvents { (accessGranted: Bool, error: Error?) in DispatchQueue.main.async { completion() } From be120aa5d01ef51a6c46316c028f5508a718fb50 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Thu, 28 Sep 2023 22:21:08 +0300 Subject: [PATCH 37/63] Update PermissionsKit.podspec --- PermissionsKit.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PermissionsKit.podspec b/PermissionsKit.podspec index 096a3dd9..9bad2cf8 100644 --- a/PermissionsKit.podspec +++ b/PermissionsKit.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PermissionsKit" - s.version = "9.2.0" + s.version = "9.2.1" s.summary = "Ask permissions with ready-use interface. You can check status permission and if it has been requested before. Support SwiftUI." s.homepage = "https://github.com/sparrowcode/PermissionsKit" s.source = { :git => "https://github.com/sparrowcode/PermissionsKit.git", :tag => s.version } From a54806370a4b9e5d3bd2e61c9d570462c8f7d835 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 2 Oct 2023 22:06:20 +0300 Subject: [PATCH 38/63] Fixed state request. --- PermissionsKit.podspec | 2 +- Sources/CalendarPermission/CalendarPermission.swift | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/PermissionsKit.podspec b/PermissionsKit.podspec index 9bad2cf8..93f1ecc2 100644 --- a/PermissionsKit.podspec +++ b/PermissionsKit.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PermissionsKit" - s.version = "9.2.1" + s.version = "9.2.2" s.summary = "Ask permissions with ready-use interface. You can check status permission and if it has been requested before. Support SwiftUI." s.homepage = "https://github.com/sparrowcode/PermissionsKit" s.source = { :git => "https://github.com/sparrowcode/PermissionsKit.git", :tag => s.version } diff --git a/Sources/CalendarPermission/CalendarPermission.swift b/Sources/CalendarPermission/CalendarPermission.swift index 8cf8f349..f7aa2286 100644 --- a/Sources/CalendarPermission/CalendarPermission.swift +++ b/Sources/CalendarPermission/CalendarPermission.swift @@ -64,6 +64,9 @@ public class CalendarPermission: Permission { } public override var status: Permission.Status { + // Fix when status first time response with other state. + let _ = EKEventStore.authorizationStatus(for: EKEntityType.event) + switch EKEventStore.authorizationStatus(for: EKEntityType.event) { case .authorized: return .authorized case .denied: return .denied From c476309e4335b2fd14c3d902f2e2076a62981e9b Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 2 Oct 2023 22:48:23 +0300 Subject: [PATCH 39/63] Merge location permissions to one permission with access. --- Package.swift | 32 ++----- PermissionsKit.podspec | 22 +---- README.md | 3 +- .../Handlers}/LocationAlwaysHandler.swift | 3 +- .../Handlers}/LocationWhenInUseHandler.swift | 3 +- .../LocationAccuracy.swift | 0 .../LocationPermission.swift} | 63 ++++++++++--- .../LocationWhenInUsePermission.swift | 89 ------------------- Sources/PermissionsKit/Data/Text.swift | 4 +- Sources/PermissionsKit/Permission.swift | 20 +++-- 10 files changed, 76 insertions(+), 163 deletions(-) rename Sources/{LocationAlwaysPermission => LocationPermission/Handlers}/LocationAlwaysHandler.swift (97%) rename Sources/{LocationWhenInUsePermission => LocationPermission/Handlers}/LocationWhenInUseHandler.swift (97%) rename Sources/{LocationExtension => LocationPermission}/LocationAccuracy.swift (100%) rename Sources/{LocationAlwaysPermission/LocationAlwaysPermission.swift => LocationPermission/LocationPermission.swift} (60%) delete mode 100644 Sources/LocationWhenInUsePermission/LocationWhenInUsePermission.swift diff --git a/Package.swift b/Package.swift index b9f2f9bb..280518bd 100644 --- a/Package.swift +++ b/Package.swift @@ -44,12 +44,8 @@ let package = Package( targets: ["SpeechRecognizerPermission"] ), .library( - name: "LocationWhenInUsePermission", - targets: ["LocationWhenInUsePermission"] - ), - .library( - name: "LocationAlwaysPermission", - targets: ["LocationAlwaysPermission"] + name: "LocationPermission", + targets: ["LocationPermission"] ), .library( name: "MotionPermission", @@ -91,12 +87,6 @@ let package = Package( .define("PERMISSIONSKIT_SPM") ] ), - .target( - name: "LocationExtension", - swiftSettings: [ - .define("PERMISSIONSKIT_SPM") - ] - ), .target( name: "CameraPermission", dependencies: [.target(name: "PermissionsKit")], @@ -162,24 +152,12 @@ let package = Package( ] ), .target( - name: "LocationWhenInUsePermission", - dependencies: [ - .target(name: "PermissionsKit"), - .target(name: "LocationExtension") - ], - swiftSettings: [ - .define("PERMISSIONSKIT_LOCATION_WHENINUSE"), - .define("PERMISSIONSKIT_SPM") - ] - ), - .target( - name: "LocationAlwaysPermission", + name: "LocationPermission", dependencies: [ - .target(name: "PermissionsKit"), - .target(name: "LocationExtension") + .target(name: "PermissionsKit") ], swiftSettings: [ - .define("PERMISSIONSKIT_LOCATION_ALWAYS"), + .define("PERMISSIONSKIT_LOCATION"), .define("PERMISSIONSKIT_SPM") ] ), diff --git a/PermissionsKit.podspec b/PermissionsKit.podspec index 93f1ecc2..62b03c3c 100644 --- a/PermissionsKit.podspec +++ b/PermissionsKit.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PermissionsKit" - s.version = "9.2.2" + s.version = "10.0.0" s.summary = "Ask permissions with ready-use interface. You can check status permission and if it has been requested before. Support SwiftUI." s.homepage = "https://github.com/sparrowcode/PermissionsKit" s.source = { :git => "https://github.com/sparrowcode/PermissionsKit.git", :tag => s.version } @@ -92,26 +92,12 @@ Pod::Spec.new do |s| "SWIFT_ACTIVE_COMPILATION_CONDITIONS" => "PERMISSIONSKIT_SPEECH PERMISSIONSKIT_COCOAPODS" } end - - s.subspec 'LocationExtension' do |subspec| - subspec.source_files = "Sources/LocationExtension/**/*.swift" - end - s.subspec 'LocationWhenInUsePermission' do |subspec| - subspec.dependency 'PermissionsKit/Core' - subspec.dependency 'PermissionsKit/LocationExtension' - subspec.source_files = "Sources/LocationWhenInUsePermission/**/*.swift" - subspec.pod_target_xcconfig = { - "SWIFT_ACTIVE_COMPILATION_CONDITIONS" => "PERMISSIONSKIT_LOCATION_WHENINUSE PERMISSIONSKIT_COCOAPODS" - } - end - - s.subspec 'LocationAlwaysPermission' do |subspec| + s.subspec 'LocationPermission' do |subspec| subspec.dependency 'PermissionsKit/Core' - subspec.dependency 'PermissionsKit/LocationExtension' - subspec.source_files = "Sources/LocationAlwaysPermission/**/*.swift" + subspec.source_files = "Sources/LocationPermission/**/*.swift" subspec.pod_target_xcconfig = { - "SWIFT_ACTIVE_COMPILATION_CONDITIONS" => "PERMISSIONSKIT_LOCATION_ALWAYS PERMISSIONSKIT_COCOAPODS" + "SWIFT_ACTIVE_COMPILATION_CONDITIONS" => "PERMISSIONSKIT_LOCATION PERMISSIONSKIT_COCOAPODS" } end diff --git a/README.md b/README.md index dc6d2ca3..8495a5f9 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,7 @@ Universal API for request permission and get its statuses. Available `.authorize | | Contacts | NSContactsUsageDescription | ✅ | ✅ | | | FaceID | NSFaceIDUsageDescription | ✅ | ✅ | | | Health | NSHealthUpdateUsageDescription, NSHealthShareUsageDescription | ✅ | ✅ | -| | Location Always | NSLocationAlwaysAndWhenInUseUsageDescription | ✅ | ✅ | -| | Location When In Use | NSLocationWhenInUseUsageDescription | ✅ | ✅ | +| | Location | NSLocationAlwaysAndWhenInUseUsageDescription NSLocationWhenInUseUsageDescription | ✅ | ✅ | | | Media Library | NSAppleMusicUsageDescription | ✅ | ✅ | | | Microphone | NSMicrophoneUsageDescription | ✅ | ✅ | | | Motion | NSMotionUsageDescription | ✅ | ✅ | diff --git a/Sources/LocationAlwaysPermission/LocationAlwaysHandler.swift b/Sources/LocationPermission/Handlers/LocationAlwaysHandler.swift similarity index 97% rename from Sources/LocationAlwaysPermission/LocationAlwaysHandler.swift rename to Sources/LocationPermission/Handlers/LocationAlwaysHandler.swift index 0b9a59a7..b0342fdc 100644 --- a/Sources/LocationAlwaysPermission/LocationAlwaysHandler.swift +++ b/Sources/LocationPermission/Handlers/LocationAlwaysHandler.swift @@ -21,10 +21,9 @@ #if PERMISSIONSKIT_SPM import PermissionsKit -import LocationExtension #endif -#if os(iOS) && PERMISSIONSKIT_LOCATION_ALWAYS +#if os(iOS) && PERMISSIONSKIT_LOCATION import Foundation import MapKit diff --git a/Sources/LocationWhenInUsePermission/LocationWhenInUseHandler.swift b/Sources/LocationPermission/Handlers/LocationWhenInUseHandler.swift similarity index 97% rename from Sources/LocationWhenInUsePermission/LocationWhenInUseHandler.swift rename to Sources/LocationPermission/Handlers/LocationWhenInUseHandler.swift index 029b0dde..f96fb7a8 100644 --- a/Sources/LocationWhenInUsePermission/LocationWhenInUseHandler.swift +++ b/Sources/LocationPermission/Handlers/LocationWhenInUseHandler.swift @@ -21,10 +21,9 @@ #if PERMISSIONSKIT_SPM import PermissionsKit -import LocationExtension #endif -#if PERMISSIONSKIT_LOCATION_WHENINUSE +#if PERMISSIONSKIT_LOCATION import Foundation import MapKit diff --git a/Sources/LocationExtension/LocationAccuracy.swift b/Sources/LocationPermission/LocationAccuracy.swift similarity index 100% rename from Sources/LocationExtension/LocationAccuracy.swift rename to Sources/LocationPermission/LocationAccuracy.swift diff --git a/Sources/LocationAlwaysPermission/LocationAlwaysPermission.swift b/Sources/LocationPermission/LocationPermission.swift similarity index 60% rename from Sources/LocationAlwaysPermission/LocationAlwaysPermission.swift rename to Sources/LocationPermission/LocationPermission.swift index 7c244a25..f318c6d6 100644 --- a/Sources/LocationAlwaysPermission/LocationAlwaysPermission.swift +++ b/Sources/LocationPermission/LocationPermission.swift @@ -21,24 +21,43 @@ #if PERMISSIONSKIT_SPM import PermissionsKit -import LocationExtension #endif -#if os(iOS) && PERMISSIONSKIT_LOCATION_ALWAYS +#if os(iOS) && PERMISSIONSKIT_LOCATION import Foundation -import MapKit +import EventKit public extension Permission { - - static var locationAlways: LocationAlwaysPermission { - return LocationAlwaysPermission() + + static func location(access: LocationAccess) -> LocationPermission { + LocationPermission(kind: .location(access: access)) } } -public class LocationAlwaysPermission: Permission { +public class LocationPermission: Permission { + + private var _kind: Permission.Kind - open override var kind: Permission.Kind { .locationAlways } - open var usageDescriptionKey: String? { "NSLocationAlwaysAndWhenInUseUsageDescription" } + // MARK: - Init + + init(kind: Permission.Kind) { + self._kind = kind + } + + open override var kind: Permission.Kind { self._kind } + open var usageDescriptionKey: String? { + switch _kind { + case .location(let access): + switch access { + case .whenInUse: + return "NSLocationWhenInUseUsageDescription" + case .always: + return "NSLocationAlwaysAndWhenInUseUsageDescription" + } + default: + fatalError() + } + } public override var status: Permission.Status { let authorizationStatus: CLAuthorizationStatus = { @@ -77,12 +96,28 @@ public class LocationAlwaysPermission: Permission { } public override func request(completion: @escaping () -> Void) { - LocationAlwaysHandler.shared = LocationAlwaysHandler() - LocationAlwaysHandler.shared?.requestPermission() { - DispatchQueue.main.async { - completion() - LocationAlwaysHandler.shared = nil + switch _kind { + case .location(let access): + switch access { + case .whenInUse: + LocationWhenInUseHandler.shared = LocationWhenInUseHandler() + LocationWhenInUseHandler.shared?.requestPermission() { + DispatchQueue.main.async { + completion() + LocationWhenInUseHandler.shared = nil + } + } + case .always: + LocationAlwaysHandler.shared = LocationAlwaysHandler() + LocationAlwaysHandler.shared?.requestPermission() { + DispatchQueue.main.async { + completion() + LocationAlwaysHandler.shared = nil + } + } } + default: + fatalError() } } } diff --git a/Sources/LocationWhenInUsePermission/LocationWhenInUsePermission.swift b/Sources/LocationWhenInUsePermission/LocationWhenInUsePermission.swift deleted file mode 100644 index effc7d51..00000000 --- a/Sources/LocationWhenInUsePermission/LocationWhenInUsePermission.swift +++ /dev/null @@ -1,89 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if PERMISSIONSKIT_SPM -import PermissionsKit -import LocationExtension -#endif - -#if PERMISSIONSKIT_LOCATION_WHENINUSE -import Foundation -import MapKit - -public extension Permission { - - static var locationWhenInUse: LocationWhenInUsePermission { - return LocationWhenInUsePermission() - } -} - -public class LocationWhenInUsePermission: Permission { - - open override var kind: Permission.Kind { .locationWhenInUse } - open var usageDescriptionKey: String? { "NSLocationAlwaysAndWhenInUseUsageDescription" } - - public override var status: Permission.Status { - let authorizationStatus: CLAuthorizationStatus = { - let locationManager = CLLocationManager() - if #available(iOS 14.0, tvOS 14.0, *) { - return locationManager.authorizationStatus - } else { - return CLLocationManager.authorizationStatus() - } - }() - - switch authorizationStatus { - #if os(iOS) - case .authorized: return .authorized - #endif - case .denied: return .denied - case .notDetermined: return .notDetermined - case .restricted: return .denied - case .authorizedAlways: return .authorized - case .authorizedWhenInUse: return .authorized - @unknown default: return .denied - } - } - - public var isPrecise: Bool { - #if os(iOS) - if #available(iOS 14.0, *) { - switch CLLocationManager().accuracyAuthorization { - case .fullAccuracy: return true - case .reducedAccuracy: return false - @unknown default: return false - } - } - #endif - return false - } - - public override func request(completion: @escaping () -> Void) { - LocationWhenInUseHandler.shared = LocationWhenInUseHandler() - LocationWhenInUseHandler.shared?.requestPermission() { - DispatchQueue.main.async { - completion() - LocationWhenInUseHandler.shared = nil - } - } - } -} -#endif diff --git a/Sources/PermissionsKit/Data/Text.swift b/Sources/PermissionsKit/Data/Text.swift index 53ba712a..b5e077c8 100644 --- a/Sources/PermissionsKit/Data/Text.swift +++ b/Sources/PermissionsKit/Data/Text.swift @@ -47,9 +47,9 @@ enum Texts { return NSLocalizedString("permission bluetooth name", bundle: bundle, comment: "") case .notification: return NSLocalizedString("permission notification name", bundle: bundle, comment: "") - case .locationWhenInUse: + case .location(access: .whenInUse): return NSLocalizedString("permission location when in use name", bundle: bundle, comment: "") - case .locationAlways: + case .location(access: .always): return NSLocalizedString("permission location always name", bundle: bundle, comment: "") case .tracking: return NSLocalizedString("permission tracking name", bundle: bundle, comment: "") diff --git a/Sources/PermissionsKit/Permission.swift b/Sources/PermissionsKit/Permission.swift index 851c67a1..753db022 100644 --- a/Sources/PermissionsKit/Permission.swift +++ b/Sources/PermissionsKit/Permission.swift @@ -109,9 +109,7 @@ open class Permission { case contacts case reminders case speech - // Upgrade location as calendar style - case locationWhenInUse - case locationAlways + case location(access: LocationAccess) case motion case mediaLibrary case bluetooth @@ -128,7 +126,9 @@ open class Permission { return "Photo Library" case .microphone: return "Microphone" - case .calendar(access: .write), .calendar(access: .full): + case .calendar(access: .write): + return "Calendar Only Write" + case .calendar(access: .full): return "Calendar" case .contacts: return "Contacts" @@ -136,8 +136,10 @@ open class Permission { return "Reminders" case .speech: return "Speech" - case .locationAlways: + case .location(access: .always): return "Location Always" + case .location(access: .whenInUse): + return "Location When Use" case .motion: return "Motion" case .mediaLibrary: @@ -146,8 +148,6 @@ open class Permission { return "Bluetooth" case .notification: return "Notification" - case .locationWhenInUse: - return "Location When Use" case .tracking: return "Tracking" case .faceID: @@ -165,4 +165,10 @@ open class Permission { case full case write } + + public enum LocationAccess { + + case whenInUse + case always + } } From 6b3863d2065f9fda1ffc10b3851aa205d6c4d094 Mon Sep 17 00:00:00 2001 From: Christoph Giesenhagen Date: Wed, 4 Oct 2023 12:36:23 +0200 Subject: [PATCH 40/63] Fix mapping of location authorization status --- Sources/LocationPermission/LocationPermission.swift | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Sources/LocationPermission/LocationPermission.swift b/Sources/LocationPermission/LocationPermission.swift index f318c6d6..2bd99124 100644 --- a/Sources/LocationPermission/LocationPermission.swift +++ b/Sources/LocationPermission/LocationPermission.swift @@ -76,8 +76,16 @@ public class LocationPermission: Permission { case .denied: return .denied case .notDetermined: return .notDetermined case .restricted: return .denied - case .authorizedAlways: return .authorized - case .authorizedWhenInUse: return .denied + case .authorizedAlways: + if case .location(let access) = _kind, access == .always { + return .authorized + } + return .denied + case .authorizedWhenInUse: + if case .location(let access) = _kind, access == .whenInUse { + return .authorized + } + return .denied @unknown default: return .denied } } From 8d6b3d6db7d0654a4e4fe31bbf6556dec6fc3d13 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Thu, 5 Oct 2023 23:05:33 +0300 Subject: [PATCH 41/63] Update PermissionsKit.podspec --- PermissionsKit.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PermissionsKit.podspec b/PermissionsKit.podspec index 62b03c3c..1ebcdc48 100644 --- a/PermissionsKit.podspec +++ b/PermissionsKit.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PermissionsKit" - s.version = "10.0.0" + s.version = "10.0.1" s.summary = "Ask permissions with ready-use interface. You can check status permission and if it has been requested before. Support SwiftUI." s.homepage = "https://github.com/sparrowcode/PermissionsKit" s.source = { :git => "https://github.com/sparrowcode/PermissionsKit.git", :tag => s.version } From d8a1933a46779cd23bee0ba1c02c24e5b3e2c68b Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Fri, 6 Oct 2023 17:43:15 +0300 Subject: [PATCH 42/63] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8495a5f9..7b2d15c9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PermissionsKit -Universal API for request permission and get its statuses. Available `.authorized`, `.denied` & `.notDetermined`. +Universal API for request permission and get its statuses - available `.authorized`, `.denied` & `.notDetermined`.

@@ -43,7 +43,7 @@ Universal API for request permission and get its statuses. Available `.authorize - [CocoaPods](#cocoapods) - [Usage](#request-permission) - [Request Permission](#request-permission) - - [Status Permission](#status-permission) + - [Get Status Permission](#get-status-permission) - [Keys in Info.plist](#keys-in-infoplist) - [Localisations](#localisation) - [Apps Using](#apps-using) @@ -81,7 +81,7 @@ In Xcode go to Project -> Your Project Name -> `Package Dependencies` -> Tap *Pl https://github.com/sparrowcode/PermissionsKit ``` -Next, choose the permissions you need. But don't add all of them, because apple will reject app. +Next, choose the permissions that you need. But don't add all of them, because apple will reject app. Or adding it to the `dependencies` of your `Package.swift`: ```swift @@ -94,7 +94,7 @@ and choose valid targets. ### CocoaPods: -This is an outdated way of doing things. I advise you to use [SPM](#swift-package-manager). However, I will continue to support Cocoapods for some time. +This is an outdated way. I advise you to use [SPM](#swift-package-manager). However, I will continue to support Cocoapods for some time.

Cocoapods Instalation @@ -138,7 +138,7 @@ Permission.notification.request { } ``` -## Status Permission +## Get Status Permission ```swift import PermissionsKit @@ -147,16 +147,16 @@ import NotificationPermission let authorized = Permission.notification.authorized ``` -## Keys in Info.plist +## Keys in `Info.plist` -You need to add some keys to the `Info.plist` file with descriptions, per Apple's requirements. You can get a plist of keys for permissions as follows: +You need to add some strings to the `Info.plist` file with descriptions per Apple's requirements. You can get a plist of keys for permissions as follows: ```swift let key = Permission.bluetooth.usageDescriptionKey ``` > **Warning** -> Do not use the description as the name of the key. +> Do not use the description as the name of the key. Xcode can't build this. ### Localisation From 7130cd5300c1b74889591b7b5b4352567994be2c Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Fri, 6 Oct 2023 17:43:34 +0300 Subject: [PATCH 43/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b2d15c9..02361f70 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PermissionsKit -Universal API for request permission and get its statuses - available `.authorized`, `.denied` & `.notDetermined`. +Universal API for request permission and get its statuses — available `.authorized`, `.denied` & `.notDetermined`.

From 4370f568fe59ba96c5b87274e4ebf765c7f6318f Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Fri, 6 Oct 2023 17:52:46 +0300 Subject: [PATCH 44/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 02361f70..18b62a6a 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ Or adding it to the `dependencies` of your `Package.swift`: ```swift dependencies: [ - .package(url: "https://github.com/sparrowcode/PermissionsKit", .upToNextMajor(from: "9.0.0")) + .package(url: "https://github.com/sparrowcode/PermissionsKit", .upToNextMajor(from: "10.0.1")) ] ``` From 3eadce105ebc7b4c13e6128bb917e1548edab2b2 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Sat, 14 Oct 2023 22:42:21 +0300 Subject: [PATCH 45/63] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 18b62a6a..4414a92a 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Universal API for request permission and get its statuses — available `.author ## Installation -Ready to use on iOS 11+. Supports iOS, tvOS and `SwiftUI`. +Ready to use on iOS 11+. Supports iOS, tvOS. Working with `UIKit` and `SwiftUI`. ### Swift Package Manager @@ -172,6 +172,7 @@ If you use xliff localization export, keys will be create automatically. If you + @@ -183,4 +184,4 @@ If you use xliff localization export, keys will be create automatically. If you

-If you use a `PermissionsKit`, add your application via Pull Request. +If you use a `PermissionsKit`, add your app via Pull Request. From b2614df1b5b0c541a0dcc51e35a6fe5f8704c098 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 16 Oct 2023 10:31:18 +0300 Subject: [PATCH 46/63] Update README.md --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4414a92a..33a6e61a 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,19 @@ Universal API for request permission and get its statuses — available `.author

- + + + + - + + + + + + + From 1b9f0a71c7a84077251ddb184b4497fd8ca03549 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Tue, 17 Oct 2023 16:22:21 +0300 Subject: [PATCH 47/63] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 33a6e61a..44f320e8 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,6 @@ If you use xliff localization export, keys will be create automatically. If you - From c73405f0a085d59e726c4d2f8b336540b50390d8 Mon Sep 17 00:00:00 2001 From: paragonnov Date: Wed, 18 Oct 2023 15:51:48 +0900 Subject: [PATCH 48/63] fix: typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44f320e8..f72b8b40 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ and choose valid targets. This is an outdated way. I advise you to use [SPM](#swift-package-manager). However, I will continue to support Cocoapods for some time. -

Cocoapods Instalation +
Cocoapods Installation [CocoaPods](https://cocoapods.org) is a dependency manager. For usage and installation instructions, visit their website. To integrate using CocoaPods, specify it in your `Podfile`: From 387f6d1867469a688c6e7e0cc06255f7f94bc738 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Thu, 9 Nov 2023 10:52:13 +0300 Subject: [PATCH 49/63] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f72b8b40..4866f542 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Universal API for request permission and get its statuses — available `.author | | Calendar | NSCalendarsUsageDescription, NSCalendarsFullAccessUsageDescription, NSCalendarsWriteOnlyAccessUsageDescription | ✅ | ✅ | | | Camera | NSCameraUsageDescription | ✅ | ✅ | | | Contacts | NSContactsUsageDescription | ✅ | ✅ | -| | FaceID | NSFaceIDUsageDescription | ✅ | ✅ | +| | FaceID | NSFaceIDUsageDescription | ☑️ | ✅ | | | Health | NSHealthUpdateUsageDescription, NSHealthShareUsageDescription | ✅ | ✅ | | | Location | NSLocationAlwaysAndWhenInUseUsageDescription NSLocationWhenInUseUsageDescription | ✅ | ✅ | | | Media Library | NSAppleMusicUsageDescription | ✅ | ✅ | @@ -156,6 +156,8 @@ import NotificationPermission let authorized = Permission.notification.authorized ``` +> For FaceID permission no way detect if request `.authorized` or `.notDetermined` accurate. Status `.denied` detect well. For now for both states return `.notDetermined`. + ## Keys in `Info.plist` You need to add some strings to the `Info.plist` file with descriptions per Apple's requirements. You can get a plist of keys for permissions as follows: From c1fd90823f9b38b388355b21a2756077c09cea95 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Thu, 9 Nov 2023 10:52:35 +0300 Subject: [PATCH 50/63] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4866f542..c84a1bb5 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,7 @@ import NotificationPermission let authorized = Permission.notification.authorized ``` +> **Warning** > For FaceID permission no way detect if request `.authorized` or `.notDetermined` accurate. Status `.denied` detect well. For now for both states return `.notDetermined`. ## Keys in `Info.plist` From f4864866fe5d75380b305839a8a54944f28aff3d Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Tue, 14 Nov 2023 22:27:52 +0300 Subject: [PATCH 51/63] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index c84a1bb5..325e11ea 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ Universal API for request permission and get its statuses — available `.author - [Installation](#installation) - [Swift Package Manager](#swift-package-manager) - [CocoaPods](#cocoapods) + - [Why Modules](#why-modules) - [Usage](#request-permission) - [Request Permission](#request-permission) - [Get Status Permission](#get-status-permission) @@ -136,6 +137,10 @@ pod 'PermissionsKit/HealthPermission', :git => 'https://github.com/sparrowcode/P ```
+## Why Modules + +If put all code to one package and compile it, Apple Review Team will see a lot of calls to permissions API and ask you provide reason why you really need it permissions. Modules allow compile only really using code parts. Just select only which you need. + ## Request Permission ```swift From f55300b298896d3336c471fc9974fd234f7062df Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Tue, 14 Nov 2023 22:29:10 +0300 Subject: [PATCH 52/63] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 325e11ea..ca8e8c9c 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,10 @@ pod 'PermissionsKit/HealthPermission', :git => 'https://github.com/sparrowcode/P ## Why Modules -If put all code to one package and compile it, Apple Review Team will see a lot of calls to permissions API and ask you provide reason why you really need it permissions. Modules allow compile only really using code parts. Just select only which you need. +If put all code to one package and compile it, Apple Review Team will see a lot of calls to permissions API and ask you provide reason why you really need it permissions. Modules allow compile only really using code parts. Just select only which you need. + +> **Warning** +> Import only the permissions you really need. ## Request Permission From 500041ad642512fb9ec88c5715c9530d7568e3d7 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Tue, 14 Nov 2023 22:31:01 +0300 Subject: [PATCH 53/63] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ca8e8c9c..5b5444d9 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ pod 'PermissionsKit/HealthPermission', :git => 'https://github.com/sparrowcode/P If put all code to one package and compile it, Apple Review Team will see a lot of calls to permissions API and ask you provide reason why you really need it permissions. Modules allow compile only really using code parts. Just select only which you need. -> **Warning** +> [!WARNING] > Import only the permissions you really need. ## Request Permission @@ -164,7 +164,7 @@ import NotificationPermission let authorized = Permission.notification.authorized ``` -> **Warning** +> [!WARNING] > For FaceID permission no way detect if request `.authorized` or `.notDetermined` accurate. Status `.denied` detect well. For now for both states return `.notDetermined`. ## Keys in `Info.plist` @@ -175,7 +175,7 @@ You need to add some strings to the `Info.plist` file with descriptions per Appl let key = Permission.bluetooth.usageDescriptionKey ``` -> **Warning** +> [!NOTE] > Do not use the description as the name of the key. Xcode can't build this. ### Localisation From 982462971e1901833929977330d4b341acaa94d8 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Thu, 30 Nov 2023 15:28:16 +0300 Subject: [PATCH 54/63] Update README.md --- README.md | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 5b5444d9..c6d09fa8 100644 --- a/README.md +++ b/README.md @@ -21,23 +21,11 @@ Universal API for request permission and get its statuses — available `.author

-### Community +### iOS Dev Community

- - - - - - - - - - - - - - + + From 888855b3cbe11a2c3776db2395b0c4794355f406 Mon Sep 17 00:00:00 2001 From: Wilson Date: Thu, 20 Jun 2024 00:33:40 +0800 Subject: [PATCH 55/63] Update README.md mod: update readme --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index c6d09fa8..596cabab 100644 --- a/README.md +++ b/README.md @@ -113,8 +113,7 @@ pod 'PermissionsKit/NotificationPermission', :git => 'https://github.com/sparrow pod 'PermissionsKit/MicrophonePermission', :git => 'https://github.com/sparrowcode/PermissionsKit' pod 'PermissionsKit/RemindersPermission', :git => 'https://github.com/sparrowcode/PermissionsKit' pod 'PermissionsKit/SpeechRecognizerPermission', :git => 'https://github.com/sparrowcode/PermissionsKit' -pod 'PermissionsKit/LocationWhenInUsePermission', :git => 'https://github.com/sparrowcode/PermissionsKit' -pod 'PermissionsKit/LocationAlwaysPermission', :git => 'https://github.com/sparrowcode/PermissionsKit' +pod 'PermissionsKit/LocationPermission', :git => 'https://github.com/sparrowcode/PermissionsKit' pod 'PermissionsKit/MotionPermission', :git => 'https://github.com/sparrowcode/PermissionsKit' pod 'PermissionsKit/MediaLibraryPermission', :git => 'https://github.com/sparrowcode/PermissionsKit' pod 'PermissionsKit/BluetoothPermission', :git => 'https://github.com/sparrowcode/PermissionsKit' From 8d434eff055e6887247613538c634201a6bec9a5 Mon Sep 17 00:00:00 2001 From: Jonas Richard Richter Date: Thu, 27 Jun 2024 15:24:22 +0200 Subject: [PATCH 56/63] Add notification permission options --- ...+userNotifcationAuthorizationOptions.swift | 42 +++++++++++++++++++ .../NotificationPermission.swift | 22 ++++++---- Sources/PermissionsKit/Permission.swift | 17 +++++++- 3 files changed, 73 insertions(+), 8 deletions(-) create mode 100644 Sources/NotificationPermission/NotificationAccess+userNotifcationAuthorizationOptions.swift diff --git a/Sources/NotificationPermission/NotificationAccess+userNotifcationAuthorizationOptions.swift b/Sources/NotificationPermission/NotificationAccess+userNotifcationAuthorizationOptions.swift new file mode 100644 index 00000000..650cde79 --- /dev/null +++ b/Sources/NotificationPermission/NotificationAccess+userNotifcationAuthorizationOptions.swift @@ -0,0 +1,42 @@ +// +// NotificationAccess+userNotifcationAuthorizationOptions.swift +// +// +// Created by Jonas Richard Richter on 18.06.24. +// + +import PermissionsKit +import UserNotifications + +extension Permission.NotificationAccess { + var userNotifcationAuthorizationOptions: UNAuthorizationOptions { + switch self { + case .badge: + .badge + case .sound: + .sound + case .alert: + .alert + case .carPlay: + .carPlay + case .criticalAlert: + .criticalAlert + case .providesAppNotificationSettings: + .providesAppNotificationSettings + case .provisional: + .provisional + case .announcement: + if #available(iOS 13.0, watchOS 6.0, *) { + .announcement + } else { + .alert + } + case .timeSensitive: + if #available(iOS 15.0, tvOS 15.0, watchOS 8.0, *) { + .timeSensitive + } else { + .alert + } + } + } +} diff --git a/Sources/NotificationPermission/NotificationPermission.swift b/Sources/NotificationPermission/NotificationPermission.swift index d2cb67ab..95bb40a6 100644 --- a/Sources/NotificationPermission/NotificationPermission.swift +++ b/Sources/NotificationPermission/NotificationPermission.swift @@ -27,15 +27,18 @@ import PermissionsKit import UserNotifications public extension Permission { - - static var notification: NotificationPermission { - return NotificationPermission() + static func notification(access: Set = [.alert, .badge, .sound]) -> NotificationPermission { + return NotificationPermission(kind: .notification(access: access)) } } public class NotificationPermission: Permission { + private var _kind: Permission.Kind + open override var kind: Permission.Kind { self._kind } - open override var kind: Permission.Kind { .notification } + init(kind: Permission.Kind) { + self._kind = kind + } public override var status: Permission.Status { guard let authorizationStatus = fetchAuthorizationStatus() else { return .notDetermined } @@ -64,10 +67,15 @@ public class NotificationPermission: Permission { public override func request(completion: @escaping () -> Void) { let center = UNUserNotificationCenter.current() - center.requestAuthorization(options:[.badge, .alert, .sound]) { (granted, error) in - DispatchQueue.main.async { - completion() + switch _kind { + case .notification(let access): + center.requestAuthorization(options: UNAuthorizationOptions(access.map { $0.userNotifcationAuthorizationOptions })) { (granted, error) in + DispatchQueue.main.async { + completion() + } } + default: + fatalError() } } } diff --git a/Sources/PermissionsKit/Permission.swift b/Sources/PermissionsKit/Permission.swift index 753db022..ddc10a12 100644 --- a/Sources/PermissionsKit/Permission.swift +++ b/Sources/PermissionsKit/Permission.swift @@ -102,7 +102,7 @@ open class Permission { public enum Kind { case camera - case notification + case notification(access: Set) case photoLibrary case microphone case calendar(access: CalendarAccess) @@ -171,4 +171,19 @@ open class Permission { case whenInUse case always } + + public enum NotificationAccess { + case badge + case sound + case alert + case carPlay + case criticalAlert + case providesAppNotificationSettings + case provisional + + @available(iOS, introduced: 13.0, deprecated: 15.0, message: "Only from iOS 13.0 to 15.0") + case announcement + @available(iOS, introduced: 15.0, deprecated: 15.0, message: "Only with iOS 15.0") + case timeSensitive + } } From f10828f2113980c06bc867c1be4075403726aad1 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Wed, 10 Jul 2024 15:57:46 +0300 Subject: [PATCH 57/63] Added support visionOS & macOS. --- Package.swift | 9 +++++---- PermissionsKit.podspec | 2 +- .../BluetoothPermission/BluetoothHandler.swift | 11 ++++++++++- .../Handlers/LocationWhenInUseHandler.swift | 16 ++++++++++++++-- Sources/PermissionsKit/Data/Text.swift | 2 +- Sources/PermissionsKit/Permission.swift | 6 ++++++ 6 files changed, 37 insertions(+), 9 deletions(-) diff --git a/Package.swift b/Package.swift index 280518bd..a632f8b6 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.3 +// swift-tools-version: 5.9 import PackageDescription @@ -6,9 +6,10 @@ let package = Package( name: "PermissionsKit", defaultLocalization: "en", platforms: [ - .iOS(.v11), - .tvOS(.v11), - .watchOS(.v3) + .iOS(.v12), + .tvOS(.v12), + .watchOS(.v4), + .macOS(.v13) ], products: [ .library( diff --git a/PermissionsKit.podspec b/PermissionsKit.podspec index 1ebcdc48..e9a49bbc 100644 --- a/PermissionsKit.podspec +++ b/PermissionsKit.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PermissionsKit" - s.version = "10.0.1" + s.version = "11.0.0" s.summary = "Ask permissions with ready-use interface. You can check status permission and if it has been requested before. Support SwiftUI." s.homepage = "https://github.com/sparrowcode/PermissionsKit" s.source = { :git => "https://github.com/sparrowcode/PermissionsKit.git", :tag => s.version } diff --git a/Sources/BluetoothPermission/BluetoothHandler.swift b/Sources/BluetoothPermission/BluetoothHandler.swift index 20c8d894..8421f49d 100644 --- a/Sources/BluetoothPermission/BluetoothHandler.swift +++ b/Sources/BluetoothPermission/BluetoothHandler.swift @@ -49,7 +49,16 @@ class BluetoothHandler: NSObject, CBCentralManagerDelegate { func centralManagerDidUpdateState(_ central: CBCentralManager) { if #available(iOS 13.0, tvOS 13, *) { - switch central.authorization { + + let authorization: CBManagerAuthorization = { + #if os(visionOS) + return CBManager.authorization + #else + return central.authorization + #endif + }() + + switch authorization { case .notDetermined: break default: diff --git a/Sources/LocationPermission/Handlers/LocationWhenInUseHandler.swift b/Sources/LocationPermission/Handlers/LocationWhenInUseHandler.swift index f96fb7a8..22d73e69 100644 --- a/Sources/LocationPermission/Handlers/LocationWhenInUseHandler.swift +++ b/Sources/LocationPermission/Handlers/LocationWhenInUseHandler.swift @@ -33,14 +33,17 @@ class LocationWhenInUseHandler: NSObject, CLLocationManagerDelegate { lazy var locationManager = CLLocationManager() + #if !os(visionOS) func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { if status == .notDetermined { return } completionHandler() } + #endif + - @available(iOS 14.0, *) + @available(iOS 14.0, macOS 11.0, watchOS 7.0, tvOS 14.0, visionOS 1.0, *) func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) { if manager.authorizationStatus == .notDetermined { return @@ -55,7 +58,16 @@ class LocationWhenInUseHandler: NSObject, CLLocationManagerDelegate { func requestPermission(_ completionHandler: @escaping () -> Void) { self.completionHandler = completionHandler - let status = CLLocationManager.authorizationStatus() + let status: CLAuthorizationStatus = { + #if os(visionOS) + locationManager.authorizationStatus + #elseif os(macOS) + locationManager.authorizationStatus + #else + CLLocationManager.authorizationStatus() + #endif + }() + switch status { case .notDetermined: locationManager.delegate = self diff --git a/Sources/PermissionsKit/Data/Text.swift b/Sources/PermissionsKit/Data/Text.swift index b5e077c8..84c9d29d 100644 --- a/Sources/PermissionsKit/Data/Text.swift +++ b/Sources/PermissionsKit/Data/Text.swift @@ -19,7 +19,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -import UIKit +import Foundation enum Texts { diff --git a/Sources/PermissionsKit/Permission.swift b/Sources/PermissionsKit/Permission.swift index 753db022..2317fa8b 100644 --- a/Sources/PermissionsKit/Permission.swift +++ b/Sources/PermissionsKit/Permission.swift @@ -19,7 +19,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +import Foundation + +#if os(iOS) import UIKit +#endif open class Permission { @@ -48,6 +52,7 @@ open class Permission { For most permissions its app page in settings app. You can overide it if your permission need open custom page. */ + #if os(iOS) @available(iOSApplicationExtension, unavailable) open func openSettingPage() { DispatchQueue.main.async { @@ -57,6 +62,7 @@ open class Permission { } } } + #endif // MARK: Must Ovveride From eb494b51b10dba1cebf6ee60c2c3a426c81ff179 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Wed, 10 Jul 2024 15:59:11 +0300 Subject: [PATCH 58/63] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 596cabab..21a9deff 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Universal API for request permission and get its statuses — available `.author ## Installation -Ready to use on iOS 11+. Supports iOS, tvOS. Working with `UIKit` and `SwiftUI`. +Ready to use on iOS 12+. Supports iOS, macOS, visionOS, tvOS & watchOS. Working with `UIKit` and `SwiftUI`. ### Swift Package Manager @@ -84,7 +84,7 @@ Or adding it to the `dependencies` of your `Package.swift`: ```swift dependencies: [ - .package(url: "https://github.com/sparrowcode/PermissionsKit", .upToNextMajor(from: "10.0.1")) + .package(url: "https://github.com/sparrowcode/PermissionsKit", .upToNextMajor(from: "11.0.0")) ] ``` From c0f8a1c32fc98a5a789a77194e6eadc61bcf1718 Mon Sep 17 00:00:00 2001 From: Abdullah Alhaider Date: Sat, 13 Jul 2024 13:39:43 +0300 Subject: [PATCH 59/63] Fix typo in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 21a9deff..1f2d33cb 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ pod 'PermissionsKit/HealthPermission', :git => 'https://github.com/sparrowcode/P ## Why Modules -If put all code to one package and compile it, Apple Review Team will see a lot of calls to permissions API and ask you provide reason why you really need it permissions. Modules allow compile only really using code parts. Just select only which you need. +If you put all your code into one package and compile it, the Apple Review Team will see a lot of calls to the permissions API. Most likely, they will ask you to provide a valid reason for why you really need those permissions. Using modules allows you to compile only the parts of the code that are actually in use. Just select only what you need. > [!WARNING] > Import only the permissions you really need. From e6a501b070090b333165996e4ec2f577582865c4 Mon Sep 17 00:00:00 2001 From: David <36027902+EchoLunar@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:00:31 +0800 Subject: [PATCH 60/63] Adapt ContactsPermission to iOS 18, changing the limited status to return as authorized. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After iOS 18, a new status limited was added to CNAuthorizationStatus - ‘This application is authorized to access some contact data.’ In the limited status, I tried using CNContactStore to fetch contact data, and it successfully retrieved the corresponding data selected by the user. Therefore, I believe this status should be treated as authorized. --- Sources/ContactsPermission/ContactsPermission.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/ContactsPermission/ContactsPermission.swift b/Sources/ContactsPermission/ContactsPermission.swift index 73597de9..45cfc1ff 100644 --- a/Sources/ContactsPermission/ContactsPermission.swift +++ b/Sources/ContactsPermission/ContactsPermission.swift @@ -40,7 +40,11 @@ public class ContactsPermission: Permission { open var usageDescriptionKey: String? { "NSContactsUsageDescription" } public override var status: Permission.Status { - switch CNContactStore.authorizationStatus(for: .contacts) { + let authorizationStatus = CNContactStore.authorizationStatus(for: .contacts) + if #available(iOS 18.0, *), authorizationStatus == .limited { + return .authorized + } + switch authorizationStatus { case .authorized: return .authorized case .denied: return .denied case .notDetermined: return .notDetermined From 5e5935998cf9c44033e429c3b7d1dd176a1f55ad Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Mon, 18 Nov 2024 16:07:26 +0300 Subject: [PATCH 61/63] Updated doc for permissions accesses. --- README.md | 4 ++-- ...+userNotifcationAuthorizationOptions.swift | 21 ++++++++++++++++--- .../NotificationPermission.swift | 4 +++- Sources/PermissionsKit/Permission.swift | 1 + 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1f2d33cb..3752aa6b 100644 --- a/README.md +++ b/README.md @@ -137,8 +137,8 @@ If you put all your code into one package and compile it, the Apple Review Team import PermissionsKit import NotificationPermission -Permission.notification.request { - +PermissionsKit.Permission.notification([.alert, .badge, .sound]).request { + } ``` diff --git a/Sources/NotificationPermission/NotificationAccess+userNotifcationAuthorizationOptions.swift b/Sources/NotificationPermission/NotificationAccess+userNotifcationAuthorizationOptions.swift index 650cde79..cbb90269 100644 --- a/Sources/NotificationPermission/NotificationAccess+userNotifcationAuthorizationOptions.swift +++ b/Sources/NotificationPermission/NotificationAccess+userNotifcationAuthorizationOptions.swift @@ -1,14 +1,29 @@ +// The MIT License (MIT) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // -// NotificationAccess+userNotifcationAuthorizationOptions.swift +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. // -// Created by Jonas Richard Richter on 18.06.24. -// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. import PermissionsKit import UserNotifications extension Permission.NotificationAccess { + var userNotifcationAuthorizationOptions: UNAuthorizationOptions { switch self { case .badge: diff --git a/Sources/NotificationPermission/NotificationPermission.swift b/Sources/NotificationPermission/NotificationPermission.swift index 95bb40a6..b9cc7782 100644 --- a/Sources/NotificationPermission/NotificationPermission.swift +++ b/Sources/NotificationPermission/NotificationPermission.swift @@ -27,12 +27,14 @@ import PermissionsKit import UserNotifications public extension Permission { - static func notification(access: Set = [.alert, .badge, .sound]) -> NotificationPermission { + + static func notification(_ access: Set = [.alert, .badge, .sound]) -> NotificationPermission { return NotificationPermission(kind: .notification(access: access)) } } public class NotificationPermission: Permission { + private var _kind: Permission.Kind open override var kind: Permission.Kind { self._kind } diff --git a/Sources/PermissionsKit/Permission.swift b/Sources/PermissionsKit/Permission.swift index 0c0dee62..cb50d2df 100644 --- a/Sources/PermissionsKit/Permission.swift +++ b/Sources/PermissionsKit/Permission.swift @@ -179,6 +179,7 @@ open class Permission { } public enum NotificationAccess { + case badge case sound case alert From e449e391217663486121449908155f3280ddecf7 Mon Sep 17 00:00:00 2001 From: Zane Shannon Date: Fri, 27 Dec 2024 18:10:59 -0800 Subject: [PATCH 62/63] Add macOS support to MicrophonePermission.swift --- .../MicrophonePermission.swift | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Sources/MicrophonePermission/MicrophonePermission.swift b/Sources/MicrophonePermission/MicrophonePermission.swift index 50a02a99..493b3240 100644 --- a/Sources/MicrophonePermission/MicrophonePermission.swift +++ b/Sources/MicrophonePermission/MicrophonePermission.swift @@ -23,7 +23,7 @@ import PermissionsKit #endif -#if os(iOS) && PERMISSIONSKIT_MICROPHONE +#if (os(iOS) || os(macOS)) && PERMISSIONSKIT_MICROPHONE import Foundation import AVFoundation @@ -40,21 +40,39 @@ public class MicrophonePermission: Permission { open var usageDescriptionKey: String? { "NSMicrophoneUsageDescription" } public override var status: Permission.Status { + #if os(iOS) switch AVAudioSession.sharedInstance().recordPermission { case .granted: return .authorized case .denied: return .denied case .undetermined: return .notDetermined @unknown default: return .denied } + #elseif os(macOS) + switch AVCaptureDevice.authorizationStatus(for: .audio) { + case .denied: return .denied + case .notDetermined: return .notDetermined + case .restricted: return .denied + case .authorized: return .authorized + @unknown default: return .denied + } + #endif } public override func request(completion: @escaping () -> Void) { + #if os(iOS) AVAudioSession.sharedInstance().requestRecordPermission { granted in DispatchQueue.main.async { completion() } } + #elseif os(macOS) + AVCaptureDevice.requestAccess(for: .audio) { _ in + DispatchQueue.main.async { + completion() + } + } + #endif } } #endif From 883290447d6490c74a6da541221b67d49487ee73 Mon Sep 17 00:00:00 2001 From: Zane Shannon Date: Wed, 26 Feb 2025 11:40:16 -0800 Subject: [PATCH 63/63] expose SpeechPermission for macOS --- Sources/SpeechRecognizerPermission/SpeechPermission.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SpeechRecognizerPermission/SpeechPermission.swift b/Sources/SpeechRecognizerPermission/SpeechPermission.swift index 85924f27..f1e05578 100644 --- a/Sources/SpeechRecognizerPermission/SpeechPermission.swift +++ b/Sources/SpeechRecognizerPermission/SpeechPermission.swift @@ -23,7 +23,7 @@ import PermissionsKit #endif -#if os(iOS) && PERMISSIONSKIT_SPEECH +#if (os(iOS) || os(macOS)) && PERMISSIONSKIT_SPEECH import Foundation import Speech