Skip to content

Commit 2f99287

Browse files
committed
Final tweaks
1 parent d653ca5 commit 2f99287

File tree

9 files changed

+59
-6
lines changed

9 files changed

+59
-6
lines changed

resources/views/docs/mobile/2/apis/device.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,27 @@ Return information about the underlying device/os/platform.
2525
Returns JSON encoded: `string`
2626

2727

28+
### `vibrate()`
29+
30+
Triggers device vibration for tactile feedback.
31+
32+
**Returns:** `void`
33+
34+
```php
35+
Device::vibrate();
36+
```
37+
38+
### `flashlight()`
39+
40+
Toggles the device flashlight (camera flash LED) on and off.
41+
42+
**Returns:** `void`
43+
44+
```php
45+
Device::flashlight(); // Toggle flashlight state
46+
```
47+
48+
2849
### `getBatteryInfo()`
2950

3051
Return information about the battery.

resources/views/docs/mobile/2/apis/haptics.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ title: Haptics
33
order: 800
44
---
55

6+
<aside>
7+
8+
#### Deprecated
9+
10+
The `Haptics` facade is marked deprecated and will be removed in a future release, use [Device](../apis/device) instead.
11+
12+
</aside>
13+
614
## Overview
715

816
The Haptics API provides access to the device's vibration and haptic feedback system for tactile user interactions.

resources/views/docs/mobile/2/apis/microphone.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ public function handleAudioRecorded(string $path, string $mimeType, ?string $id)
191191

192192
- **Microphone Permission:** The first time your app requests microphone access, users will be prompted for permission. If denied, recording functions will fail silently.
193193

194+
- **Microphone Background Permission:** You can allow your app to record audio while the device is locked by toggling `microphone_background` to true in [the config](../getting-started/configuration)
195+
194196
- **File Format:** Recordings are stored as M4A/AAC audio files (`.m4a`). This format is optimized for small file sizes while maintaining quality.
195197

196198
- **Recording State:** Only one recording can be active at a time. Calling `start()` while a recording is in progress will return `false`.

resources/views/docs/mobile/2/apis/system.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use Native\Mobile\Facades\System;
1313

1414
## Methods
1515

16-
### `flashlight()`
16+
### `flashlight()` - Deprecated, see [Device](device)
1717

1818
Toggles the device flashlight (camera flash LED) on and off.
1919

@@ -34,3 +34,9 @@ Determines if the current device is running iOS.
3434
Determines if the current device is running Android.
3535

3636
**Returns:** `true` if Android, `false` otherwise
37+
38+
### `isMobile()`
39+
40+
Determines if the current device is running Android or iOS.
41+
42+
**Returns:** `true` if Android or iOS, `false` otherwise

resources/views/docs/mobile/2/edge-components/introduction.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,19 @@ use Blade's battle-tested processing engine to rapidly compile the necessary tra
7373
They can be defined in any Blade file, but for them to be processed, that Blade file will need to be rendered. We
7474
recommend putting your components in a Blade component that is likely to be rendered on every request, such as your
7575
main layout, e.g. `layouts/app.blade.php` or one of its child views/components.
76+
77+
## Using Inertia?
78+
79+
Each link in an EDGE component will do a full post back to PHP, which may not be what you want if you are using Inertia. To transform these requests into Inertia `<Link>`, add `router` to your `window` object:
80+
81+
```typescript
82+
import { router } from '@inertiajs/vue3';
83+
84+
declare global {
85+
interface Window {
86+
router: typeof router;
87+
}
88+
}
89+
90+
window.router = router;
91+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ reasons why your app needs certain permissions. You can do this easily from the
117117
- `location` - Allows your application to request access to the device's GPS receiver, if present. Note that the user
118118
may deny this and any location functions will then result in a no-op.
119119
- `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.
121-
- `storage_write` - Allows your app to write to device storage.
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.
122122
- `microphone` - Allows your application to request access to the device's microphone, if present. Required for audio
123123
recording functionality. Note that the user may deny access and any microphone functions will then result in a no-op.
124124
- `microphone_background` - Allows your application to request access to the device's microphone, if present. Required

resources/views/docs/mobile/2/the-basics/app-icon.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Place a single high-resolution icon file at: `public/icon.png`.
1212
### Requirements
1313
- Format: PNG
1414
- Size: 1024 × 1024 pixels
15-
- Background: Transparent or solid — your choice
15+
- Background: Must not contain any transparencies.
1616
- GD PHP extension must be enabled, ensure it has enough memory (~2GB should be enough)
1717

1818
This image will be automatically resized for all Android densities and used as the base iOS app icon.

resources/views/docs/mobile/2/the-basics/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ register your event listeners. Here's an example using the amazing Vue:
148148
import { on, Events } from '#nativephp';
149149
import { onMounted } from 'vue';
150150

151-
const handleButtonPressed = (index, label) => {};
151+
const handleButtonPressed = (payload: any) => {};
152152

153153
onMounted(() => {
154154
on(Events.Alert.ButtonPressed, handleButtonPressed);

resources/views/docs/mobile/2/the-basics/native-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Though this will be optional, so you have total freedom of choice and could even
3030
When using a web view and using JavaScript you may also interact with the native functions easily from JavaScript using
3131
our convenient `Native` library.
3232

33-
This is especially useful if you're building applications with an SPA framework, like Vue or React, as you can simply
33+
This is especially useful if you're building applications with a SPA framework, like Vue or React, as you can simply
3434
import the functions you need and move a lot of work into the reactive part of your UI.
3535

3636
### Install the plugin

0 commit comments

Comments
 (0)