Преглед изворни кода

[RN] Drop the react-native-permissions dependency

It causes false positives when submitting the app to the Store. Use the new
permissions API in react-native-webrtc instead.
master
Saúl Ibarra Corretgé пре 6 година
родитељ
комит
a327a5d804

+ 0
- 2
ios/Podfile Прегледај датотеку

@@ -35,8 +35,6 @@ target 'JitsiMeet' do
35 35
   pod 'react-native-locale-detector',
36 36
     :path => '../node_modules/react-native-locale-detector'
37 37
   pod 'react-native-webrtc', :path => '../node_modules/react-native-webrtc'
38
-  pod 'ReactNativePermissions',
39
-    :path => '../node_modules/react-native-permissions'
40 38
   pod 'RNSound', :path => '../node_modules/react-native-sound'
41 39
   pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
42 40
   pod 'react-native-calendar-events',

+ 1
- 7
ios/Podfile.lock Прегледај датотеку

@@ -63,8 +63,6 @@ PODS:
63 63
     - React/Core
64 64
     - React/fishhook
65 65
     - React/RCTBlob
66
-  - ReactNativePermissions (1.1.1):
67
-    - React
68 66
   - RNSound (0.10.9):
69 67
     - React/Core
70 68
     - RNSound/Core (= 0.10.9)
@@ -98,7 +96,6 @@ DEPENDENCIES:
98 96
   - React/RCTNetwork (from `../node_modules/react-native`)
99 97
   - React/RCTText (from `../node_modules/react-native`)
100 98
   - React/RCTWebSocket (from `../node_modules/react-native`)
101
-  - ReactNativePermissions (from `../node_modules/react-native-permissions`)
102 99
   - RNSound (from `../node_modules/react-native-sound`)
103 100
   - RNVectorIcons (from `../node_modules/react-native-vector-icons`)
104 101
   - yoga (from `../node_modules/react-native/ReactCommon/yoga`)
@@ -130,8 +127,6 @@ EXTERNAL SOURCES:
130 127
     :path: "../node_modules/react-native-locale-detector"
131 128
   react-native-webrtc:
132 129
     :path: "../node_modules/react-native-webrtc"
133
-  ReactNativePermissions:
134
-    :path: "../node_modules/react-native-permissions"
135 130
   RNSound:
136 131
     :path: "../node_modules/react-native-sound"
137 132
   RNVectorIcons:
@@ -152,12 +147,11 @@ SPEC CHECKSUMS:
152 147
   react-native-keep-awake: 0de4bd66de0c23178107dce0c2fcc3354b2a8e94
153 148
   react-native-locale-detector: d1b2c6fe5abb56e3a1efb6c2d6f308c05c4251f1
154 149
   react-native-webrtc: 31b6d3f1e3e2ce373aa43fd682b04367250f807d
155
-  ReactNativePermissions: 9ef3f0c74a373fdbfae21c067098a8348d9aa15f
156 150
   RNSound: b360b3862d3118ed1c74bb9825696b5957686ac4
157 151
   RNVectorIcons: c0dbfbf6068fefa240c37b0f71bd03b45dddac44
158 152
   SDWebImage: 624d6e296c69b244bcede364c72ae0430ac14681
159 153
   yoga: a23273df0088bf7f2bb7e5d7b00044ea57a2a54a
160 154
 
161
-PODFILE CHECKSUM: 1d5c8382f73d9540fac68d93b32e1d3b58d069ee
155
+PODFILE CHECKSUM: 69d3df0b8baa54d636bd653b412ed45db771a3b6
162 156
 
163 157
 COCOAPODS: 1.5.3

+ 0
- 4
package-lock.json Прегледај датотеку

@@ -12785,10 +12785,6 @@
12785 12785
       "version": "github:jitsi/react-native-locale-detector#845281e9fd4af756f6d0f64afe5cce08c63e5ee9",
12786 12786
       "from": "github:jitsi/react-native-locale-detector#845281e9fd4af756f6d0f64afe5cce08c63e5ee9"
12787 12787
     },
12788
-    "react-native-permissions": {
12789
-      "version": "github:lyubomir/react-native-permissions#3462430addce3f2c8297c15da14182568194a216",
12790
-      "from": "github:lyubomir/react-native-permissions#3462430addce3f2c8297c15da14182568194a216"
12791
-    },
12792 12788
     "react-native-prompt": {
12793 12789
       "version": "1.0.0",
12794 12790
       "resolved": "https://registry.npmjs.org/react-native-prompt/-/react-native-prompt-1.0.0.tgz",

+ 0
- 1
package.json Прегледај датотеку

@@ -69,7 +69,6 @@
69 69
     "react-native-keep-awake": "2.0.6",
70 70
     "react-native-linear-gradient": "2.4.0",
71 71
     "react-native-locale-detector": "github:jitsi/react-native-locale-detector#845281e9fd4af756f6d0f64afe5cce08c63e5ee9",
72
-    "react-native-permissions": "github:lyubomir/react-native-permissions#3462430addce3f2c8297c15da14182568194a216",
73 72
     "react-native-prompt": "1.0.0",
74 73
     "react-native-sound": "0.10.9",
75 74
     "react-native-vector-icons": "4.4.2",

+ 5
- 1
react/features/base/lib-jitsi-meet/native/polyfills-webrtc.js Прегледај датотеку

@@ -3,7 +3,8 @@ import {
3 3
     MediaStreamTrack,
4 4
     RTCSessionDescription,
5 5
     RTCIceCandidate,
6
-    mediaDevices
6
+    mediaDevices,
7
+    permissions
7 8
 } from 'react-native-webrtc';
8 9
 
9 10
 import RTCPeerConnection from './RTCPeerConnection';
@@ -34,6 +35,9 @@ import RTCPeerConnection from './RTCPeerConnection';
34 35
         if (typeof navigator.mediaDevices === 'undefined') {
35 36
             navigator.mediaDevices = mediaDevices;
36 37
         }
38
+        if (typeof navigator.permissions === 'undefined') {
39
+            navigator.permissions = permissions;
40
+        }
37 41
     }
38 42
 
39 43
 })(global || window || this); // eslint-disable-line no-invalid-this

+ 2
- 3
react/features/welcome/components/WelcomePage.native.js Прегледај датотеку

@@ -8,7 +8,6 @@ import {
8 8
     TouchableOpacity,
9 9
     View
10 10
 } from 'react-native';
11
-import Permissions from 'react-native-permissions';
12 11
 import { connect } from 'react-redux';
13 12
 
14 13
 import { translate } from '../../base/i18n';
@@ -76,8 +75,8 @@ class WelcomePage extends AbstractWelcomePage {
76 75
             // Make sure we don't request the permission for the camera from
77 76
             // the start. We will, however, create a video track iff the user
78 77
             // already granted the permission.
79
-            Permissions.check('camera').then(response => {
80
-                response === 'authorized'
78
+            navigator.permissions.query({ name: 'camera' }).then(response => {
79
+                response === 'granted'
81 80
                     && dispatch(createDesiredLocalTracks(MEDIA_TYPE.VIDEO));
82 81
             });
83 82
         }

Loading…
Откажи
Сачувај