@@ -22,12 +22,12 @@ about whether a particular feature is specific to iOS or Android.
22
22
Most of the system-related features are available through the ` System ` facade.
23
23
24
24
``` php
25
- use Native\Laravel \Facades\System;
25
+ use Native\Ios \Facades\System;
26
26
```
27
27
28
28
## Camera
29
29
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 :
31
31
32
32
``` php
33
33
$imageData = System::camera()
@@ -50,6 +50,40 @@ decline, triggering the camera API will silently fail.**
50
50
51
51
** COMING SOON**
52
52
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
+
53
87
## Accelerometer
54
88
55
89
** COMING SOON**
@@ -115,23 +149,24 @@ For devices that support some form of biometric identification, you can use this
115
149
of your application.
116
150
117
151
``` php
118
- if (System::canPromptBiometricID() && System::promptBiometricID('access your Contacts' )) {
152
+ if (System::promptForBiometricID( )) {
119
153
// Do your super secret activity here
120
154
}
121
155
```
122
156
123
157
Using this, you can gate certain parts of your app, allowing you to offer an extra layer of protection for your user's
124
158
data.
125
159
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.**
129
163
130
164
## Time Zones
131
165
132
166
** COMING SOON**
133
167
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.
135
170
136
171
This means that, for the most part, any dates and times your show will already be in the appropriate time zone for the
137
172
user without having to ask your users to manually select their current time zone.
0 commit comments