Skip to content

Commit 0bfed28

Browse files
committed
Update mobile v3 docs for SDK 29+ support and configurable SDK versions
- Add Android SDK Versions section to configuration docs - Remove permissions section from configuration (moved elsewhere) - Update environment setup to reflect API 29+ minimum - Add WebView compatibility note for Tailwind v4 on older devices - Update plugin docs min_version examples from 33 to 29
1 parent 3355326 commit 0bfed28

5 files changed

Lines changed: 57 additions & 69 deletions

File tree

resources/views/docs/mobile/3/getting-started/configuration.md

Lines changed: 37 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -67,68 +67,6 @@ The `cleanup_exclude_files` array in the config file allows you to specify files
6767
before bundling. This is useful for removing files like logs or other temporary files that aren't required for your app
6868
to function and bloat your downloads.
6969

70-
## Permissions
71-
In general, the app stores don't want your app to have permissions (a.k.a entitlements) it doesn't need.
72-
73-
By default, all optional permissions are disabled.
74-
75-
You may enable the features you intend to use simply by changing the value of the appropriate permission to `true`:
76-
77-
```php
78-
'permissions' => [
79-
'biometric' => false,
80-
'camera' => false,
81-
'location' => false,
82-
'microphone' => false,
83-
'microphone_background' => false,
84-
'network_state' => true,
85-
'nfc' => false,
86-
'push_notifications' => false,
87-
'storage_read' => false,
88-
'storage_write' => false,
89-
'scanner' => false,
90-
'vibrate' => false,
91-
],
92-
```
93-
94-
For iOS, this will provide a sensible default description.
95-
96-
### Custom permission descriptions
97-
98-
For iOS, it's possible to define custom permission descriptions. In most cases, you are required to provide clear
99-
reasons why your app needs certain permissions. You can do this easily from the config file:
100-
101-
```php
102-
'permissions' => [
103-
'biometric' => 'Access to the biometric sensor is needed to secure user resources',
104-
//...
105-
],
106-
```
107-
108-
### Available permissions
109-
110-
- `biometric` - Allows your application to use fingerprint or face-recognition hardware (with a fallback to PIN code)
111-
to secure parts of your application.
112-
- `camera` - Allows your application to request access to the device's camera, if present. Required for taking photos and
113-
recording video. Note that the user may deny access and any camera functions will then result in a no-op.
114-
- `nfc` - Allows your application to request access to the device's NFC reader, if present.
115-
- `push_notifications` - Allows your application to request permissions to send push notifications. Note that the user
116-
may deny this and any push notification functions will then result in a no-op.
117-
- `location` - Allows your application to request access to the device's GPS receiver, if present. Note that the user
118-
may deny this and any location functions will then result in a no-op.
119-
- `vibrate` - In modern Android devices this is a requirement for most haptic feedback.
120-
- `storage_read` - Grants your app access to read from device storage locations. This is not required for basic app file manipulation.
121-
- `storage_write` - Allows your app to write to device storage. This is not required for basic app file manipulation.
122-
- `microphone` - Allows your application to request access to the device's microphone, if present. Required for audio
123-
recording functionality. Note that the user may deny access and any microphone functions will then result in a no-op.
124-
- `microphone_background` - Allows your application to request access to the device's microphone, if present. Required
125-
for audio recording functionality. Note that the user may deny access and any microphone functions will then result in
126-
a no-op.
127-
- `scanner` - Allows your application to scan QR codes and barcodes. Note that the user may deny camera access and any
128-
scanning functions will then result in a no-op.
129-
- `network_state` - Allows your application to access information about the device's network connectivity status. This
130-
permission is enabled by default as it's commonly needed for basic network state detection.
131-
13270
## Orientation
13371

13472
NativePHP (as of v1.10.3) allows users to custom specific orientations per device through the config file. The config
@@ -173,3 +111,40 @@ Once you've published an app with iPad support, it cannot be undone. If you wish
173111
will need to change your `NATIVEPHP_APP_ID` and publish the app under a new App Store listing.
174112

175113
</aside>
114+
115+
## Android SDK Versions
116+
117+
The `android` section of your config file lets you control which Android SDK versions are used when building your app.
118+
These are nested under the `android` key in `config/nativephp.php`:
119+
120+
```php
121+
'android' => [
122+
'compile_sdk' => env('NATIVEPHP_ANDROID_COMPILE_SDK', 36),
123+
'min_sdk' => env('NATIVEPHP_ANDROID_MIN_SDK', 33),
124+
'target_sdk' => env('NATIVEPHP_ANDROID_TARGET_SDK', 36),
125+
],
126+
```
127+
128+
- `compile_sdk` - The SDK version used to compile your app. This determines which Android APIs are available to you
129+
at build time. (default: `36`)
130+
- `min_sdk` - The minimum Android version your app supports. Devices running an older version won't be able to install
131+
your app. (default: `33`, Android 13)
132+
- `target_sdk` - The SDK version your app is designed and tested against. Google Play uses this to apply appropriate
133+
compatibility behaviors. (default: `36`)
134+
135+
You can also set these via environment variables:
136+
137+
```dotenv
138+
NATIVEPHP_ANDROID_COMPILE_SDK=36
139+
NATIVEPHP_ANDROID_MIN_SDK=33
140+
NATIVEPHP_ANDROID_TARGET_SDK=36
141+
```
142+
143+
<aside>
144+
145+
Most apps won't need to change these defaults. Only adjust them if you have a specific reason, such as supporting
146+
older devices or targeting a newer API level. Always ensure that `compile_sdk` >= `target_sdk` >= `min_sdk`.
147+
148+
The lowest supported `min_sdk` is `29` (Android 10). Setting it lower than this is not supported.
149+
150+
</aside>

resources/views/docs/mobile/3/getting-started/environment-setup.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ to develop and test your apps on a Simulator. However, you will need to enroll w
6767
## Android Requirements
6868

6969
1. [Android Studio 2024.2.1 or later](https://developer.android.com/studio)
70-
2. Android SDK with API 33 or higher
70+
2. Android SDK with API 29 or higher
7171
3. **Windows only**: You must have [7zip](https://www.7-zip.org/) installed.
7272

7373
<aside>
@@ -91,8 +91,8 @@ To check the installed Gradle version, examine the ``nativephp/android/.gradle``
9191
2. **Install Android SDK**
9292
- Open Android Studio
9393
- Navigate to **Tools → SDK Manager**
94-
- In the **SDK Platforms** tab, install at least one Android SDK platform for API 33 or higher
95-
- Latest stable version: Android 15 (API 35)
94+
- In the **SDK Platforms** tab, install at least one Android SDK platform for API 29 or higher
95+
- Latest stable version: Android 16 (API 36)
9696
- You only need to install one API version to get started
9797
- In the **SDK Tools** tab, ensure **Android SDK Build-Tools** and **Android SDK Platform-Tools** are installed
9898

resources/views/docs/mobile/3/plugins/advanced-configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,18 +314,18 @@ Specify minimum platform versions your plugin requires:
314314
```json
315315
{
316316
"android": {
317-
"min_version": 33
317+
"min_version": 29
318318
},
319319
"ios": {
320320
"min_version": "18.0"
321321
}
322322
}
323323
```
324324

325-
- **Android** — Minimum SDK version (integer, e.g., `33` for Android 13)
325+
- **Android** — Minimum SDK version (integer, e.g., `29` for Android 10)
326326
- **iOS** — Minimum iOS version (string, e.g., `"18.0"`)
327327

328-
NativePHP currently requires a minimum of Android SDK 33 and iOS 18. Your plugin's minimum versions cannot be lower
328+
NativePHP currently supports a minimum of Android SDK 29 and iOS 18. Your plugin's minimum versions cannot be lower
329329
than these. Use this field when your plugin requires a higher version than NativePHP's baseline.
330330

331331
If a user's app targets a lower version than your plugin requires, they'll receive a warning during plugin validation.

resources/views/docs/mobile/3/plugins/best-practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ your plugin is properly integrated with the NativePHP build pipeline:
297297
```json
298298
{
299299
"android": {
300-
"min_version": 33
300+
"min_version": 29
301301
}
302302
}
303303
```

resources/views/docs/mobile/3/the-basics/web-view.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,18 @@ But note that this will overwrite any changes you've made to your copy of this c
128128

129129
</aside>
130130

131+
## WebView Compatibility
132+
133+
On Android, the web view is powered by the system's built-in WebView component, which varies by device and OS version.
134+
Older Android versions ship with older WebView engines that may not support modern CSS features.
135+
136+
For example, Tailwind CSS v4 uses `@theme` and other newer CSS features that are not supported on older WebView
137+
versions. If you are targeting a lower `min_sdk` to support older devices, consider using Tailwind CSS v3 or another
138+
CSS framework that generates compatible output. You can configure your minimum SDK version in your
139+
[Android SDK Versions](/docs/mobile/3/getting-started/configuration#android-sdk-versions) settings.
140+
141+
Always test your app on emulators running your minimum supported Android version to catch these issues early. You can
142+
create emulators for older API levels in Android Studio's Virtual Device Manager.
143+
131144
With just a few small changes, we've been able to define a layout that will work well on a multitude of devices
132145
without having to add complex calculations or lots of device-specific CSS rules to our code.

0 commit comments

Comments
 (0)