File tree 2 files changed +2
-40
lines changed
2 files changed +2
-40
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ Thanks to [Eddy Verbruggen](EddyVerbruggen) for providing [nativescript-taptic-e
14
14
* [ Use @nativescript/haptics ] ( #use-nativescripthaptics )
15
15
* [ API] ( #api )
16
16
* [ isSupported()] ( #issupported )
17
- * [ is6SAnd6SPlusSupported()] ( #is6sand6splussupported )
18
17
* [ selection()] ( #selection )
19
18
* [ notifcation()] ( #notification )
20
19
* [ impact()] ( #impact )
@@ -44,14 +43,6 @@ isHapticsSupported: boolean = Haptics.isSupported()
44
43
```
45
44
Checks if haptics is supported on the device.
46
45
47
- ---
48
- ### is6SAnd6SPlusSupported()
49
- ``` ts
50
- isHapticsSupported : boolean = Haptics .is6SAnd6SPlusSupported ()
51
- ```
52
-
53
- Checks if Haptics is supported on iOS.
54
-
55
46
---
56
47
### selection()
57
48
@@ -97,7 +88,7 @@ There are 3 impact types:
97
88
To use the haptics fallbacks, check if there is support:
98
89
99
90
``` ts
100
- if (! Haptics .isSupported () && Haptics . is6SAnd6SPlusSupported () ) {
91
+ if (! Haptics .isSupported ()) {
101
92
// use HapticsFallback
102
93
}
103
94
```
Original file line number Diff line number Diff line change @@ -9,12 +9,7 @@ let generatorSelection: UISelectionFeedbackGenerator;
9
9
10
10
export class Haptics {
11
11
static isSupported ( ) {
12
- return Utils . SDK_VERSION >= 10.0 && deviceInfo ( ) . version > 8 ;
13
- }
14
-
15
- static is6SAnd6SPlusSupported ( ) {
16
- const details = deviceInfo ( ) ;
17
- return Utils . SDK_VERSION >= 10.0 && ( details . name ?. indexOf ( 'iPhone8,1' ) > - 1 || details . name ?. indexOf ( 'iPhone8,2' ) > - 1 ) ;
12
+ return Utils . SDK_VERSION >= 10.0 ;
18
13
}
19
14
20
15
static notification ( type ?: HapticNotificationType ) {
@@ -94,27 +89,3 @@ export class HapticsFallback {
94
89
AudioServicesPlaySystemSound ( 1521 ) ;
95
90
}
96
91
}
97
-
98
- function deviceInfo ( ) {
99
- const _SYS_NAMELEN : number = 256 ;
100
-
101
- const buffer : any = interop . alloc ( 5 * _SYS_NAMELEN ) ;
102
- // @ts -expect-error
103
- uname ( buffer ) ;
104
- let name : string = NSString . stringWithUTF8String ( buffer . add ( _SYS_NAMELEN * 4 ) ) . toString ( ) ;
105
-
106
- // Get machine name for Simulator
107
- if ( name === 'x86_64' || name === 'i386' || name === 'arm64' ) {
108
- name = NSProcessInfo . processInfo . environment . objectForKey ( 'SIMULATOR_MODEL_IDENTIFIER' ) ;
109
- }
110
-
111
- const parts = name . toLowerCase ( ) . split ( 'iphone' ) ;
112
- let version : number ;
113
- if ( parts && parts . length > 1 ) {
114
- version = parseInt ( parts [ 1 ] ) ;
115
- }
116
- return {
117
- name,
118
- version : isNaN ( version ) ? 0 : version ,
119
- } ;
120
- }
You can’t perform that action at this time.
0 commit comments