Skip to content

Commit 1c0ad47

Browse files
committed
More docs updates
1 parent cd6f1d0 commit 1c0ad47

File tree

12 files changed

+161
-412
lines changed

12 files changed

+161
-412
lines changed

resources/views/docs/mobile/1/_index.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ NativePHP for Mobile revolutionizes mobile development by allowing PHP developer
1111

1212
## What Makes NativePHP Mobile Special?
1313

14-
=€ **Native Performance** - Your app runs natively on device with embedded PHP runtime
15-
**True Mobile APIs** - Access camera, biometrics, push notifications, and more
16-
¡ **Laravel Powered** - Use your existing Laravel skills and ecosystem
17-
=' **No Web Server** - Your app runs entirely on-device
18-
**Cross Platform** - Single codebase for iOS and Android
14+
📱**Native Performance** - Your app runs natively on device with embedded PHP runtime
15+
🔥**True Mobile APIs** - Access camera, biometrics, push notifications, and more
16+
**Laravel Powered** - Use your existing Laravel skills and ecosystem
17+
🚫**No Web Server** - Your app runs entirely on-device
18+
🔄**Cross Platform** - Single codebase for iOS and Android
1919

2020
## Quick Start
2121

@@ -35,19 +35,19 @@ php artisan native:run
3535
## Current Features (v1.1)
3636

3737
**Available now:**
38-
- Camera & Gallery access
39-
- = Biometric authentication (Face ID, Touch ID, Fingerprint)
40-
- = Push notifications via Firebase
41-
- Native dialogs & toasts
42-
- = Deep links & universal links
43-
- NFC support
44-
- Haptic feedback & vibration
45-
- =& Flashlight control
46-
- Native sharing
47-
- = Secure storage (Keychain/Keystore)
48-
- Location services
49-
50-
[See the complete roadmap ](/docs/mobile/1/getting-started/roadmap)
38+
- 📷 Camera & Gallery access
39+
- 🔐 Biometric authentication (Face ID, Touch ID, Fingerprint)
40+
- 🔔 Push notifications via Firebase
41+
- 💬 Native dialogs & toasts
42+
- 🔗 Deep links & universal links
43+
- 📱 NFC support
44+
- 📳 Haptic feedback & vibration
45+
- 🔦 Flashlight control
46+
- 📤 Native sharing
47+
- 🔒 Secure storage (Keychain/Keystore)
48+
- 📍 Location services
49+
50+
[See the complete roadmap 🗺️](/docs/mobile/1/getting-started/roadmap)
5151

5252
## Documentation Sections
5353

@@ -96,4 +96,4 @@ Advanced topics for production apps:
9696
- **Community** - Join our Discord for support and discussions
9797
- **Examples** - Check out the Kitchen Sink demo app (coming soon to app stores)
9898

99-
Ready to build your first mobile app with PHP? [Let's get started! ](/docs/mobile/1/getting-started/introduction)
99+
Ready to build your first mobile app with PHP? [Let's get started! 🚀](/docs/mobile/1/getting-started/introduction)

resources/views/docs/mobile/1/apis/_index.md

Lines changed: 0 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -2,139 +2,3 @@
22
title: APIs
33
order: 4
44
---
5-
6-
# API Reference
7-
8-
Complete documentation for all NativePHP Mobile APIs. Each API provides access to native device capabilities through familiar PHP facades.
9-
10-
## Available APIs
11-
12-
### [Biometrics](/docs/mobile/1/apis/biometrics)
13-
**Face ID, Touch ID, Fingerprint Authentication**
14-
```php
15-
Biometrics::promptForBiometricID();
16-
```
17-
Secure user authentication using device biometric sensors. Supports Face ID on iOS, Touch ID, and fingerprint readers on Android.
18-
19-
### [Camera](/docs/mobile/1/apis/camera)
20-
**Photo Capture & Gallery Access**
21-
```php
22-
Camera::getPhoto();
23-
Camera::pickImages('images', true, 5);
24-
```
25-
Take photos with the device camera or select images from the photo gallery. Supports both single and multiple image selection.
26-
27-
### [Dialog](/docs/mobile/1/apis/dialog)
28-
**Native UI Elements**
29-
```php
30-
Dialog::alert('Title', 'Message', $buttons, $callback);
31-
Dialog::toast('Success message');
32-
Dialog::share('Title', 'Text', 'https://example.com');
33-
```
34-
Display native alerts, toast notifications, and sharing interfaces that match platform design guidelines.
35-
36-
### [Geolocation](/docs/mobile/1/apis/geolocation) ⭐ New in v1.1
37-
**GPS & Location Services**
38-
```php
39-
Geolocation::getCurrentPosition(true); // High accuracy
40-
Geolocation::checkPermissions();
41-
Geolocation::requestPermissions();
42-
```
43-
Access device location services with configurable accuracy levels and proper permission handling.
44-
45-
### [Haptics](/docs/mobile/1/apis/haptics)
46-
**Vibration & Tactile Feedback**
47-
```php
48-
Haptics::vibrate();
49-
```
50-
Provide tactile feedback for user interactions, form validation, and important events.
51-
52-
### [PushNotifications](/docs/mobile/1/apis/push-notifications)
53-
**Firebase Cloud Messaging**
54-
```php
55-
PushNotifications::enrollForPushNotifications();
56-
PushNotifications::getPushNotificationsToken();
57-
```
58-
Register devices for push notifications and manage FCM tokens for server-side notification delivery.
59-
60-
### [SecureStorage](/docs/mobile/1/apis/secure-storage) ⭐ New in v1.1
61-
**Keychain & Keystore Operations**
62-
```php
63-
SecureStorage::set('api_token', $token);
64-
$token = SecureStorage::get('api_token');
65-
SecureStorage::delete('api_token');
66-
```
67-
Store sensitive data securely using iOS Keychain and Android Keystore with automatic encryption.
68-
69-
### [System](/docs/mobile/1/apis/system)
70-
**System Functions & Legacy API**
71-
```php
72-
System::flashlight(); // Toggle flashlight
73-
```
74-
Control system functions like the flashlight. Also provides deprecated methods that have moved to dedicated facades.
75-
76-
## API Patterns
77-
78-
### Synchronous APIs
79-
Execute immediately and return results:
80-
- `Haptics::vibrate()`
81-
- `System::flashlight()`
82-
- `Dialog::toast()`
83-
- `SecureStorage::set()` / `get()`
84-
85-
### Asynchronous APIs
86-
Trigger operations and fire events when complete:
87-
- `Camera::getPhoto()``PhotoTaken` event
88-
- `Biometrics::promptForBiometricID()``Completed` event
89-
- `PushNotifications::enrollForPushNotifications()``TokenGenerated` event
90-
- `Geolocation::getCurrentPosition()``LocationReceived` event
91-
92-
### Event Handling
93-
All async APIs use Laravel events with Livewire integration:
94-
95-
```php
96-
use Livewire\Attributes\On;
97-
use Native\Mobile\Events\Camera\PhotoTaken;
98-
99-
#[On('native:' . PhotoTaken::class)]
100-
public function handlePhotoTaken(string $path)
101-
{
102-
// Process the captured photo
103-
}
104-
```
105-
106-
## Migration from System Facade
107-
108-
Many methods have moved from the `System` facade to dedicated facades in v1.1:
109-
110-
| Old (Deprecated) | New (Recommended) |
111-
|------------------|-------------------|
112-
| `System::camera()` | `Camera::getPhoto()` |
113-
| `System::vibrate()` | `Haptics::vibrate()` |
114-
| `System::promptForBiometricID()` | `Biometrics::promptForBiometricID()` |
115-
| `System::enrollForPushNotifications()` | `PushNotifications::enrollForPushNotifications()` |
116-
| `System::secureSet()` / `secureGet()` | `SecureStorage::set()` / `get()` |
117-
118-
The old methods still work but are deprecated. See the [System API documentation](/docs/mobile/1/apis/system) for complete migration guidance.
119-
120-
## Platform Support
121-
122-
All APIs work on both iOS and Android with platform-appropriate implementations:
123-
- **iOS**: Uses native iOS frameworks and APIs
124-
- **Android**: Uses Android SDK and native libraries
125-
- **Permissions**: Automatically handled with user prompts when required
126-
- **Fallbacks**: Graceful degradation when features aren't available
127-
128-
## Error Handling
129-
130-
APIs provide both success and error events for proper error handling:
131-
132-
```php
133-
#[On('native:' . PhotoTaken::class)]
134-
public function handleSuccess($data) { /* ... */ }
135-
136-
#[On('native:' . PermissionDenied::class)]
137-
public function handleError($error) { /* ... */ }
138-
```
139-
140-
Each API documentation includes complete error handling examples and best practices.

resources/views/docs/mobile/1/apis/biometrics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Prompts the user for biometric authentication.
1919

2020
## Events
2121

22-
### `Native\Mobile\Events\Biometric\Completed`
22+
### `Completed`
2323

2424
Fired when biometric authentication completes (success or failure).
2525

resources/views/docs/mobile/1/apis/camera.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Camera::pickImages('all', true);
4444

4545
## Events
4646

47-
### `Native\Mobile\Events\Camera\PhotoTaken`
47+
### `PhotoTaken`
4848

4949
Fired when a photo is taken with the camera.
5050

@@ -62,7 +62,7 @@ public function handlePhotoTaken(string $path)
6262
}
6363
```
6464

65-
### `Native\Mobile\Events\Gallery\MediaSelected`
65+
### `MediaSelected`
6666

6767
Fired when media is selected from the gallery.
6868

resources/views/docs/mobile/1/apis/dialog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Dialog::share(
6767

6868
## Events
6969

70-
### `Native\Mobile\Events\Alert\ButtonPressed`
70+
### `ButtonPressed`
7171

7272
Fired when a button is pressed in an alert dialog.
7373

@@ -246,4 +246,4 @@ Dialog::share(
246246
- All dialogs automatically support screen readers
247247
- Button text should be descriptive
248248
- Toast messages are announced by accessibility services
249-
- Consider users with motor disabilities when designing button layouts
249+
- Consider users with motor disabilities when designing button layouts

resources/views/docs/mobile/1/apis/geolocation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Geolocation::requestPermissions();
5252

5353
## Events
5454

55-
### `Geolocation\LocationReceived`
55+
### `LocationReceived`
5656

5757
Fired when location data is requested (success or failure).
5858

@@ -93,7 +93,7 @@ public function handleLocationReceived($success = null, $latitude = null, $longi
9393
}
9494
```
9595

96-
### `Geolocation\PermissionStatusReceived`
96+
### `PermissionStatusReceived`
9797

9898
Fired when permission status is checked.
9999

@@ -128,7 +128,7 @@ public function handlePermissionStatus($location, $coarseLocation, $fineLocation
128128
}
129129
```
130130

131-
### `Geolocation\PermissionRequestResult`
131+
### `PermissionRequestResult`
132132

133133
Fired when a permission request completes.
134134

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,3 @@ class HapticsExample extends Component
7878
**Use haptics for:** Button presses, form validation, important notifications, game events
7979
**Avoid haptics for:** Frequent events, background processes, minor updates
8080

81-
## Migration from System Facade
82-
83-
```php
84-
// Old way (deprecated)
85-
use Native\Mobile\Facades\System;
86-
System::vibrate();
87-
88-
// New way (recommended)
89-
use Native\Mobile\Facades\Haptics;
90-
Haptics::vibrate();
91-
```

0 commit comments

Comments
 (0)