Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
864 changes: 500 additions & 364 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/css/filament/filament/app.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/filament/forms/components/date-time-picker.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/filament/tables/components/table.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions resources/views/docs/mobile/1/apis/device.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: Device
order: 200
---

## Overview

The Device API exposes internal information about the device, such as the model and operating system version, along with user information such as unique ids.
```php
use Native\Mobile\Facades\Device;
```

## Methods

### `getId()`

Return a unique identifier for the device.

Returns: `string`

### `getInfo()`

Return information about the underlying device/os/platform.

Returns JSON encoded: `string`


### `getBatteryInfo()`

Return information about the battery.

Returns JSON encoded: `string`

## Device Info

| Prop | Type | Description
|---|---|---|---|
| name | string | The name of the device. For example, "John's iPhone". On iOS 16+ this will return a generic device name without the appropriate entitlements.
| model | string | The device model. For example, "iPhone13,4".
| platform | 'ios' \| 'android' | The device platform (lowercase).
| operatingSystem | string | The operating system of the device.
| osVersion | string | The version of the device OS.
| iOSVersion | number | The iOS version number. Only available on iOS. Multi-part version numbers are crushed down into an integer padded to two-digits, e.g., "16.3.1" → `160301`. | 5.0.0 |
| androidSDKVersion | number | The Android SDK version number. Only available on Android. | 5.0.0 |
| manufacturer | string | The manufacturer of the device.
| isVirtual | boolean | Whether the app is running in a simulator/emulator.
| memUsed | number | Approximate memory used by the current app, in bytes. Divide by 1,048,576 to get MBs used.
| webViewVersion | string | The web view browser version.

## Battery Info

| Prop | Type | Description
|---|---|---|---|
| batteryLevel | number | A percentage (0 to 1) indicating how much the battery is charged.
| isCharging | boolean | Whether the device is charging.
32 changes: 32 additions & 0 deletions resources/views/docs/mobile/1/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,36 @@ You may enable the features you intend to use simply by changing the value of th
may deny this and any push notification functions will then result in a no-op.
- `location` - Allows your application to request access to the device's GPS receiver, if present. Note that the user
may deny this and any location functions will then result in a no-op.
- `vibrate` - In modern Android devices this is a requirement for most haptic feedback.
- `storage_read` - Grants your app access to read from device storage locations.
- `storage_write` - Allows your app to write to device storage.

## Orientation

NativePHP (as of v1.10.3) allows users to custom specific orientations per device through the config file. The config allows for granularity for iPad, iPhone and Android devices. Options for each device can be seen below.

NOTE: if you want to disable iPad support completely simply apply `false` for each option.

```php
'orientation' => [
'iPhone' => [
'portrait' => true,
'upside_down' => false,
'landscape_left' => false,
'landscape_right' => false,
],
'iPad' => [
'portrait' => true,
'upside_down' => false,
'landscape_left' => false,
'landscape_right' => false,
],
'android' => [
'portrait' => true,
'upside_down' => false,
'landscape_left' => false,
'landscape_right' => false,
],
],
```