Skip to content

Commit 99af314

Browse files
committed
Update docs
1 parent e7f7405 commit 99af314

File tree

4 files changed

+48
-13
lines changed

4 files changed

+48
-13
lines changed

resources/views/docs/mobile/1/digging-deeper/security.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ protect your users.
1010

1111
### Secrets and .env
1212

13-
As your application is being installed on systems outside of your/your organisation's control, it is important to think
13+
As your application is being installed on systems outside your/your organisation's control, it is important to think
1414
of the environment that it's in as _potentially_ hostile, which is to say that any secrets, passwords or keys
1515
could fall into the hands of someone who might try to abuse them.
1616

@@ -22,7 +22,7 @@ application and any API use a robust and secure authentication protocol, such as
2222
distribute unique and expiring tokens (an expiration date less than 48 hours in the future is recommended) with a high
2323
level of entropy, as this makes them hard to guess and hard to abuse.
2424

25-
Always use HTTPS.
25+
**Always use HTTPS.**
2626

2727
If your application allows users to connect _their own_ API keys for a service, you should treat these keys with great
2828
care. If you choose to store them anywhere (either in a [File](files) or

resources/views/docs/mobile/1/the-basics/dialogs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ NativePHP allows you to trigger many native dialogs.
1010
Dialogs are created using the `Dialog` facade.
1111

1212
```php
13-
use Native\Laravel\Dialog;
13+
use Native\Ios\Facades\Dialog;
1414
```
1515

1616
### The Share Dialog
@@ -31,7 +31,7 @@ $buttons = [
3131
'Cancel'
3232
];
3333

34-
Dialog::share('Title', 'Message', $buttons, fn ($selected) => {
34+
Dialog::alert('Title', 'Message', $buttons, fn ($selected) => {
3535
echo "You selected {$buttons[$selected]}";
3636
});
3737
```

resources/views/docs/mobile/1/the-basics/notifications.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ order: 500
66
## Notifications
77

88
NativePHP allows you to send system notifications using an elegant PHP API. These notifications are, unlike Laravel's
9-
built-in notifications, actual UI notifications displayed by the device's native notification UI.
9+
built-in notifications, actual device notifications displayed by the device's native notification UI.
1010

1111
When used sparingly, notifications can be a great way to inform the user about events that are occurring in your
1212
application and to bring their attention back to it, especially if further input from them is required.
1313

1414
Notifications are sent using the `Notification` facade.
1515

1616
```php
17-
use Native\Laravel\Facades\Notification;
17+
use Native\Ios\Facades\Notification;
1818
```
1919

2020
### Sending Notifications

resources/views/docs/mobile/1/the-basics/system.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ about whether a particular feature is specific to iOS or Android.
2222
Most of the system-related features are available through the `System` facade.
2323

2424
```php
25-
use Native\Laravel\Facades\System;
25+
use Native\Ios\Facades\System;
2626
```
2727

2828
## Camera
2929

30-
You may request the native camera interface to take a photograph by calling:
30+
You may request the native camera interface to take a photograph by calling the `camera` method:
3131

3232
```php
3333
$imageData = System::camera()
@@ -50,6 +50,40 @@ decline, triggering the camera API will silently fail.**
5050

5151
**COMING SOON**
5252

53+
## Vibration
54+
55+
You may vibrate the user's device by calling the `vibrate` method:
56+
57+
```php
58+
System::vibrate()
59+
```
60+
61+
## Push Notifications
62+
63+
NativePHP makes it dead simple to enrol your user's device in push notifications from your app.
64+
65+
Simply use the `enrolForPushNotifications` method to trigger enrolment. If this is the first time that your app tries
66+
to enrol this device for push notifications, the user will be presented with a native alert, allowing them to opt-in.
67+
68+
Then use the `getPushNotificationsToken` method to retrieve the token. If enrolment was unsuccessful for some reason,
69+
this method will return `null`.
70+
71+
```php
72+
System::enrolForPushNotifications();
73+
74+
// Later...
75+
76+
if ($token = System::getPushNotificationsToken()) {
77+
// Do something with the token...
78+
}
79+
```
80+
81+
Once you have the token, you may use it from your server-based applications to trigger Push Notifications directly to
82+
your user's device.
83+
84+
Find out more about what's required to use Push Notifications in
85+
[Apple's Developer docs](https://developer.apple.com/notifications/).
86+
5387
## Accelerometer
5488

5589
**COMING SOON**
@@ -115,23 +149,24 @@ For devices that support some form of biometric identification, you can use this
115149
of your application.
116150

117151
```php
118-
if (System::canPromptBiometricID() && System::promptBiometricID('access your Contacts')) {
152+
if (System::promptForBiometricID()) {
119153
// Do your super secret activity here
120154
}
121155
```
122156

123157
Using this, you can gate certain parts of your app, allowing you to offer an extra layer of protection for your user's
124158
data.
125159

126-
**Note: Biometric identification only gives you greater *confidence* that the person using your app is someone who has
127-
the capacity to unlock the device your app is installed on. It does not allow you to *identify* that user or prove that
128-
they are willingly taking this action.**
160+
**Note: Despite the name, Biometric identification only gives you *greater confidence* that the person using your app
161+
is *someone* who has the capacity to unlock the device your app is installed on. It does not allow you to *identify*
162+
that user or prove that they are willingly taking this action.**
129163

130164
## Time Zones
131165

132166
**COMING SOON**
133167

134-
PHP and your Laravel application will be configured to work with the time zone that the device is configured to use.
168+
PHP and your Laravel application are configured to work with the time zone that the device reports it is currently
169+
operating in.
135170

136171
This means that, for the most part, any dates and times your show will already be in the appropriate time zone for the
137172
user without having to ask your users to manually select their current time zone.

0 commit comments

Comments
 (0)