|
1 | | -# permissions-kit |
2 | | -A unified way to check permission status and request permissions for iOS and Android in Unity. |
| 1 | +# 📲 Permissions Kit |
| 2 | + |
| 3 | +**Simplify cross-platform permission management in Unity applications** |
| 4 | + |
| 5 | +Permissions Kit is a robust permission management framework designed to streamline access control in **Unity** projects. With a unified API for **iOS** and **Android**, it removes the complexity of platform-specific implementations—allowing you to request, verify, and manage app permissions with ease and consistency. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## ✨ Key Features |
| 10 | + |
| 11 | +### ✅ Unified API for Cross-Platform Permission Handling |
| 12 | +- A single, streamlined API to manage permissions on **iOS** and **Android**. |
| 13 | +- Reduces platform-specific permission handling complexity. |
| 14 | + |
| 15 | +### 📊 Comprehensive Permission Support |
| 16 | +Permissions Kit supports a wide range of permissions across both platforms: |
| 17 | + |
| 18 | +- **Network & Connectivity**: Internet access, network state, Wi-Fi, and local network permissions. |
| 19 | +- **Location Services**: Fine and coarse location tracking, including background access. |
| 20 | +- **Notifications**: Push notification permissions with user consent management. |
| 21 | +- **Media Access**: Read and write permissions for images, videos, and audio files. |
| 22 | +- **Hardware Access**: Camera, microphone, Bluetooth, and vibration control. |
| 23 | + |
| 24 | +### 🔧 Automated Configuration for iOS and Android |
| 25 | +- **iOS**: Automatically adds the required usage descriptions in `Info.plist`. |
| 26 | +- **Android**: Automatically updates `AndroidManifest.xml` with necessary permissions, features, and hardware requirements. |
| 27 | +- **No Manual Setup Required**: Permissions Kit takes care of all necessary configurations for both platforms. |
| 28 | + |
| 29 | +### 🛠️ Simple and Efficient API |
| 30 | +Permissions Kit offers a developer-friendly API for requesting and checking permissions: |
| 31 | + |
| 32 | +```csharp |
| 33 | +using VoxelBusters.PermissionsKit; |
| 34 | + |
| 35 | +// Create a PermissionRequest instance |
| 36 | +PermissionRequest request = new PermissionRequest.Builder() |
| 37 | + .AddPermission(Permission.USE_CAMERA) |
| 38 | + .AddPermission(Permission.PUSH_NOTIFICATIONS) |
| 39 | + .ShowApplicationSettingsIfDeniedOrRestricted(true) |
| 40 | + .Build(); |
| 41 | + |
| 42 | +// Request permissions |
| 43 | +PermissionsKit.Request(request, (PermissionRequestResult result) => |
| 44 | +{ |
| 45 | + if (result.Authorized()) |
| 46 | + { |
| 47 | + Debug.Log("✅ Permissions granted!"); |
| 48 | + } |
| 49 | + else |
| 50 | + { |
| 51 | + Debug.Log("🚫 Permissions denied."); |
| 52 | + } |
| 53 | +}); |
| 54 | + |
| 55 | +// Check the status of a specific permission |
| 56 | +PermissionStatus status = PermissionsKit.GetStatus(Permission.RECORD_AUDIO); |
| 57 | +``` |
| 58 | +### 📈 Advanced Permission Management for Better DX (Developer Experience) |
| 59 | + |
| 60 | +**Smart Handling**: Prevents unnecessary prompts if permissions are already granted. |
| 61 | +**Development Mode Alerts**: Warns developers about missing configurations during development. |
| 62 | +**User-Friendly Experience**: |
| 63 | +- Displays helpful alerts if a user denies a permission. |
| 64 | +- Provides an option to open the app’s settings to manually enable permissions. |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +## 🚀 Getting Started |
| 69 | + |
| 70 | +### 📥 Installation |
| 71 | +To install **Permissions Kit** in your Unity project, follow these steps: |
| 72 | + |
| 73 | +1. Go to the **Releases** section of the repository. |
| 74 | +2. Download the latest `.unitypackage` file. |
| 75 | +3. Open your Unity project. |
| 76 | +4. Drag and drop the downloaded `.unitypackage` into your project, or use **Assets > Import Package > Custom Package** to import it. |
| 77 | +5. Enable the permissions you want to use in Window -> Voxel Busters -> Permissions Kit settings |
| 78 | + |
| 79 | +**Permissions Kit** is now ready to use in your project. |
| 80 | + |
| 81 | +--- |
| 82 | + |
| 83 | +## 📊 Supported Permissions |
| 84 | +Here are the key permission categories supported by **Permissions Kit**: |
| 85 | + |
| 86 | +| Category | Permissions | |
| 87 | +|-----------------|-------------------------------------------------------| |
| 88 | +| 📡 Network | Internet, Network State, Wi-Fi, Local Network | |
| 89 | +| 📍 Location | Fine Location, Coarse Location, Background | |
| 90 | +| 🔔 Notifications| Push Notifications, Consent Management | |
| 91 | +| 📸 Media Access| Camera, Audio Recording, Image/Video Access | |
| 92 | +| 🔌 Hardware | Microphone, Bluetooth, Vibration Control | |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +## 📋 Permission Status |
| 97 | +**Permissions Kit** supports the following statuses: |
| 98 | + |
| 99 | +- **Unknown**: Permission status is unknown or not yet requested. |
| 100 | +- **Granted**: Permission is approved by the user. |
| 101 | +- **Limited**: Permission is approved by the user but with limited access. |
| 102 | +- **Restricted**: System-level policies restrict access. |
| 103 | +- **Denied**: User has denied the permission. |
| 104 | + |
| 105 | +--- |
| 106 | +### **Unlock More Features with [Essential Kit](https://link.voxelbusters.com/essential-kit)** |
| 107 | + |
| 108 | +While Permissions Kit efficiently manages app permissions, if you need access to additional native features such as: |
| 109 | + |
| 110 | +- **Local and Remote Notifications** |
| 111 | + |
| 112 | +- **In-App Purchases (Consumables, Non-Consumables & Subscriptions)** |
| 113 | + |
| 114 | +- **WebView** |
| 115 | + |
| 116 | +- **Leaderboards & Achievements** |
| 117 | + |
| 118 | +- **Cloud Save** |
| 119 | + |
| 120 | +- **Task Services (Allow app in background)** |
| 121 | + |
| 122 | +- **App Updater** |
| 123 | + |
| 124 | +- **App Review** |
| 125 | + |
| 126 | +- **Deep Links** |
| 127 | + |
| 128 | +- **Sharing** |
| 129 | + |
| 130 | +- **And More** |
| 131 | + |
| 132 | + |
| 133 | +Explore [**Essential Kit**](https://link.voxelbusters.com/essential-kit) to enhance your Unity development experience with a powerful suite of features tailored for mobile game developers. |
| 134 | + |
| 135 | +--- |
| 136 | + |
| 137 | +## 🤝 Contribution |
| 138 | +We welcome contributions to **Permissions Kit**! If you'd like to contribute, please follow these steps: |
| 139 | + |
| 140 | +1. Fork the repository. |
| 141 | +2. Create a new branch (`feature/my-feature`). |
| 142 | +3. Commit your changes. |
| 143 | +4. Open a pull request with a detailed description of your changes. |
| 144 | + |
| 145 | +--- |
| 146 | + |
| 147 | +## 📄 License |
| 148 | +**Permissions Kit** is licensed under the **MIT License** – see the LICENSE file for details. |
| 149 | + |
| 150 | +--- |
| 151 | + |
| 152 | +## 📧 Support |
| 153 | +For questions or support, feel free to open an issue or contact us via **Voxel Busters**. |
| 154 | + |
| 155 | +--- |
| 156 | + |
| 157 | +**🛠️ Simplify your permission management with Permissions Kit – Built for Unity!** |
0 commit comments