Mathieu Acthernoene 7 лет назад
Родитель
Сommit
7d868238da

+ 1
- 1
.npmignore Просмотреть файл

@@ -1 +1 @@
1
-example
1
+example/

+ 9
- 6
example/.flowconfig Просмотреть файл

@@ -12,14 +12,15 @@
12 12
 ; For RN Apps installed via npm, "Libraries" folder is inside
13 13
 ; "node_modules/react-native" but in the source repo it is in the root
14 14
 .*/Libraries/react-native/React.js
15
-.*/Libraries/react-native/ReactNative.js
15
+
16
+; Ignore polyfills
17
+.*/Libraries/polyfills/.*
16 18
 
17 19
 [include]
18 20
 
19 21
 [libs]
20 22
 node_modules/react-native/Libraries/react-native/react-native-interface.js
21
-node_modules/react-native/flow
22
-flow/
23
+node_modules/react-native/flow/
23 24
 
24 25
 [options]
25 26
 emoji=true
@@ -32,14 +33,16 @@ module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|we
32 33
 
33 34
 suppress_type=$FlowIssue
34 35
 suppress_type=$FlowFixMe
36
+suppress_type=$FlowFixMeProps
37
+suppress_type=$FlowFixMeState
35 38
 suppress_type=$FixMe
36 39
 
37
-suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
38
-suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
40
+suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
41
+suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
39 42
 suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
40 43
 suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
41 44
 
42 45
 unsafe.enable_getters_and_setters=true
43 46
 
44 47
 [version]
45
-^0.49.1
48
+^0.56.0

+ 4
- 4
example/.gitignore Просмотреть файл

@@ -46,8 +46,8 @@ buck-out/
46 46
 # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47 47
 # screenshots whenever they are needed.
48 48
 # For more information about the recommended setup visit:
49
-# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
49
+# https://docs.fastlane.tools/best-practices/source-control/
50 50
 
51
-fastlane/report.xml
52
-fastlane/Preview.html
53
-fastlane/screenshots
51
+*/fastlane/report.xml
52
+*/fastlane/Preview.html
53
+*/fastlane/screenshots

example/Example.js → example/App.js Просмотреть файл

@@ -1,8 +1,4 @@
1
-/**
2
- * Sample React Native App
3
- * https://github.com/facebook/react-native
4
- * @flow
5
- */
1
+// @flow
6 2
 
7 3
 import React, { Component } from 'react'
8 4
 import {
@@ -17,7 +13,7 @@ import {
17 13
 
18 14
 import Permissions from 'react-native-permissions'
19 15
 
20
-export default class Example extends Component {
16
+export default class App extends Component {
21 17
   state = {
22 18
     types: [],
23 19
     status: {},
@@ -29,28 +25,24 @@ export default class Example extends Component {
29 25
 
30 26
     this.setState({ types, canOpenSettings })
31 27
     this._updatePermissions(types)
32
-    AppState.addEventListener('change', this._handleAppStateChange.bind(this))
28
+    AppState.addEventListener('change', this._handleAppStateChange)
33 29
   }
34 30
 
35 31
   componentWillUnmount() {
36
-    AppState.removeEventListener(
37
-      'change',
38
-      this._handleAppStateChange.bind(this),
39
-    )
32
+    AppState.removeEventListener('change', this._handleAppStateChange)
40 33
   }
41 34
 
42 35
   //update permissions when app comes back from settings
43
-  _handleAppStateChange(appState) {
36
+  _handleAppStateChange = appState => {
44 37
     if (appState == 'active') {
45 38
       this._updatePermissions(this.state.types)
46 39
     }
47 40
   }
48 41
 
49
-  _openSettings() {
50
-    return Permissions.openSettings().then(() => alert('back to app!!'))
51
-  }
42
+  _openSettings = () =>
43
+    Permissions.openSettings().then(() => alert('back to app!!'))
52 44
 
53
-  _updatePermissions(types) {
45
+  _updatePermissions = types => {
54 46
     Permissions.checkMultiple(types)
55 47
       .then(status => {
56 48
         if (this.state.isAlways) {
@@ -64,7 +56,7 @@ export default class Example extends Component {
64 56
       .then(status => this.setState({ status }))
65 57
   }
66 58
 
67
-  _requestPermission(permission) {
59
+  _requestPermission = permission => {
68 60
     var options
69 61
 
70 62
     if (permission == 'location') {
@@ -81,7 +73,7 @@ export default class Example extends Component {
81 73
           if (this.state.canOpenSettings)
82 74
             buttons.push({
83 75
               text: 'Open Settings',
84
-              onPress: this._openSettings.bind(this),
76
+              onPress: this._openSettings,
85 77
             })
86 78
 
87 79
           Alert.alert(
@@ -94,7 +86,7 @@ export default class Example extends Component {
94 86
       .catch(e => console.warn(e))
95 87
   }
96 88
 
97
-  _onLocationSwitchChange() {
89
+  _onLocationSwitchChange = () => {
98 90
     this.setState({ isAlways: !this.state.isAlways })
99 91
     this._updatePermissions(this.state.types)
100 92
   }
@@ -106,7 +98,7 @@ export default class Example extends Component {
106 98
           <TouchableHighlight
107 99
             style={[styles.button, styles[this.state.status[p]]]}
108 100
             key={p}
109
-            onPress={this._requestPermission.bind(this, p)}
101
+            onPress={() => this._requestPermission(p)}
110 102
           >
111 103
             <View>
112 104
               <Text style={styles.text}>
@@ -121,13 +113,13 @@ export default class Example extends Component {
121 113
         <View style={styles.footer}>
122 114
           <TouchableHighlight
123 115
             style={styles['footer_' + Platform.OS]}
124
-            onPress={this._onLocationSwitchChange.bind(this)}
116
+            onPress={this._onLocationSwitchChange}
125 117
           >
126 118
             <Text style={styles.text}>Toggle location type</Text>
127 119
           </TouchableHighlight>
128 120
 
129 121
           {this.state.canOpenSettings && (
130
-            <TouchableHighlight onPress={this._openSettings.bind(this)}>
122
+            <TouchableHighlight onPress={this._openSettings}>
131 123
               <Text style={styles.text}>Open settings</Text>
132 124
             </TouchableHighlight>
133 125
           )}

+ 5
- 1
example/android/app/build.gradle Просмотреть файл

@@ -72,6 +72,10 @@ import com.android.build.OutputFile
72 72
  * ]
73 73
  */
74 74
 
75
+project.ext.react = [
76
+    entryFile: "index.js"
77
+]
78
+
75 79
 apply from: "../../node_modules/react-native/react.gradle"
76 80
 
77 81
 /**
@@ -95,7 +99,7 @@ android {
95 99
 
96 100
     defaultConfig {
97 101
         applicationId "com.example"
98
-        minSdkVersion 21
102
+        minSdkVersion 16
99 103
         targetSdkVersion 23
100 104
         versionCode 1
101 105
         versionName "1.0"

+ 4
- 0
example/android/app/src/main/AndroidManifest.xml Просмотреть файл

@@ -15,6 +15,10 @@
15 15
     <uses-permission android:name="android.permission.READ_SMS"/>
16 16
     <uses-permission android:name="android.permission.RECEIVE_SMS"/>
17 17
 
18
+    <uses-sdk
19
+        android:minSdkVersion="16"
20
+        android:targetSdkVersion="23" />
21
+
18 22
     <application
19 23
       android:name=".MainApplication"
20 24
       android:allowBackup="true"

+ 5
- 0
example/android/app/src/main/java/com/example/MainApplication.java Просмотреть файл

@@ -25,6 +25,11 @@ public class MainApplication extends Application implements ReactApplication {
25 25
           new MainReactPackage()
26 26
       );
27 27
     }
28
+
29
+    @Override
30
+    protected String getJSMainModuleName() {
31
+      return "index";
32
+    }
28 33
   };
29 34
 
30 35
   @Override

+ 0
- 1
example/android/app/src/main/res/values/strings.xml Просмотреть файл

@@ -1,4 +1,3 @@
1 1
 <resources>
2
-
3 2
     <string name="app_name">Example</string>
4 3
 </resources>

+ 1
- 0
example/android/build.gradle Просмотреть файл

@@ -6,6 +6,7 @@ buildscript {
6 6
     }
7 7
     dependencies {
8 8
         classpath 'com.android.tools.build:gradle:2.2.3'
9
+
9 10
         // NOTE: Do not place your application dependencies here; they belong
10 11
         // in the individual module build.gradle files
11 12
     }

+ 1
- 2
example/android/gradle/wrapper/gradle-wrapper.properties Просмотреть файл

@@ -1,6 +1,5 @@
1
-#Fri Feb 03 16:27:32 CET 2017
2 1
 distributionBase=GRADLE_USER_HOME
3 2
 distributionPath=wrapper/dists
4 3
 zipStoreBase=GRADLE_USER_HOME
5 4
 zipStorePath=wrapper/dists
6
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
5
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

+ 4
- 0
example/app.json Просмотреть файл

@@ -0,0 +1,4 @@
1
+{
2
+  "name": "Example",
3
+  "displayName": "Example"
4
+}

+ 0
- 12
example/index.android.js Просмотреть файл

@@ -1,12 +0,0 @@
1
-/**
2
- * Sample React Native App
3
- * https://github.com/facebook/react-native
4
- * @flow
5
- */
6
-
7
-import React, { Component } from 'react'
8
-import { AppRegistry } from 'react-native'
9
-
10
-import Example from './Example'
11
-
12
-AppRegistry.registerComponent('Example', () => Example)

+ 0
- 12
example/index.ios.js Просмотреть файл

@@ -1,12 +0,0 @@
1
-/**
2
- * Sample React Native App
3
- * https://github.com/facebook/react-native
4
- * @flow
5
- */
6
-
7
-import React, { Component } from 'react'
8
-import { AppRegistry } from 'react-native'
9
-
10
-import Example from './Example'
11
-
12
-AppRegistry.registerComponent('Example', () => Example)

+ 4
- 0
example/index.js Просмотреть файл

@@ -0,0 +1,4 @@
1
+import { AppRegistry } from 'react-native'
2
+import App from './App'
3
+
4
+AppRegistry.registerComponent('Example', () => App)

+ 121
- 34
example/ios/Example.xcodeproj/project.pbxproj Просмотреть файл

@@ -25,17 +25,17 @@
25 25
 		2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
26 26
 		2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
27 27
 		2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
28
-		2D02E4C21E0B4AEC006451C7 /* libRCTAnimation-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */; };
28
+		2D02E4C21E0B4AEC006451C7 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
29 29
 		2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */; };
30 30
 		2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */; };
31 31
 		2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */; };
32 32
 		2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */; };
33 33
 		2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */; };
34 34
 		2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; };
35
-		2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
35
+		2D02E4C91E0B4AEC006451C7 /* libReact-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact-tvOS.a */; };
36 36
 		2DCD954D1E0B4F2C00145EB5 /* ExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ExampleTests.m */; };
37 37
 		5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
38
-		6D05A8F55CC4482AACFFC932 /* libReactNativePermissions.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DF4131A2930454297EF564B /* libReactNativePermissions.a */; };
38
+		66F16C091FC608C600E71FEB /* libReactNativePermissions.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 66F16C071FC608A900E71FEB /* libReactNativePermissions.a */; };
39 39
 		832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
40 40
 		ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
41 41
 /* End PBXBuildFile section */
@@ -216,6 +216,34 @@
216 216
 			remoteGlobalIDString = 2D2A28201D9B03D100D4039D;
217 217
 			remoteInfo = "RCTAnimation-tvOS";
218 218
 		};
219
+		66F16BED1FC608A800E71FEB /* PBXContainerItemProxy */ = {
220
+			isa = PBXContainerItemProxy;
221
+			containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */;
222
+			proxyType = 2;
223
+			remoteGlobalIDString = ADD01A681E09402E00F6D226;
224
+			remoteInfo = "RCTBlob-tvOS";
225
+		};
226
+		66F16BFF1FC608A800E71FEB /* PBXContainerItemProxy */ = {
227
+			isa = PBXContainerItemProxy;
228
+			containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
229
+			proxyType = 2;
230
+			remoteGlobalIDString = 3DBE0D001F3B181A0099AA32;
231
+			remoteInfo = fishhook;
232
+		};
233
+		66F16C011FC608A800E71FEB /* PBXContainerItemProxy */ = {
234
+			isa = PBXContainerItemProxy;
235
+			containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
236
+			proxyType = 2;
237
+			remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32;
238
+			remoteInfo = "fishhook-tvOS";
239
+		};
240
+		66F16C061FC608A900E71FEB /* PBXContainerItemProxy */ = {
241
+			isa = PBXContainerItemProxy;
242
+			containerPortal = 0D173517D64E4E0C9D1491B9 /* ReactNativePermissions.xcodeproj */;
243
+			proxyType = 2;
244
+			remoteGlobalIDString = 9D23B34F1C767B80008B4819;
245
+			remoteInfo = ReactNativePermissions;
246
+		};
219 247
 		78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {
220 248
 			isa = PBXContainerItemProxy;
221 249
 			containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
@@ -249,6 +277,7 @@
249 277
 		00E356EE1AD99517003FC87E /* ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
250 278
 		00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
251 279
 		00E356F21AD99517003FC87E /* ExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleTests.m; sourceTree = "<group>"; };
280
+		0D173517D64E4E0C9D1491B9 /* ReactNativePermissions.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = ReactNativePermissions.xcodeproj; path = "../node_modules/react-native-permissions/ReactNativePermissions.xcodeproj"; sourceTree = "<group>"; };
252 281
 		139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = "<group>"; };
253 282
 		139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = "<group>"; };
254 283
 		13B07F961A680F5B00A75B9A /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -259,10 +288,8 @@
259 288
 		13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Example/Info.plist; sourceTree = "<group>"; };
260 289
 		13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Example/main.m; sourceTree = "<group>"; };
261 290
 		146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
262
-		1CB53DB705894AAA8CB22783 /* ReactNativePermissions.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = ReactNativePermissions.xcodeproj; path = "../node_modules/react-native-permissions/ReactNativePermissions.xcodeproj"; sourceTree = "<group>"; };
263 291
 		2D02E47B1E0B4A5D006451C7 /* Example-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
264 292
 		2D02E4901E0B4A5D006451C7 /* Example-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Example-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
265
-		5DF4131A2930454297EF564B /* libReactNativePermissions.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libReactNativePermissions.a; sourceTree = "<group>"; };
266 293
 		5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
267 294
 		78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
268 295
 		832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
@@ -295,7 +322,7 @@
295 322
 				832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
296 323
 				00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
297 324
 				139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
298
-				6D05A8F55CC4482AACFFC932 /* libReactNativePermissions.a in Frameworks */,
325
+				66F16C091FC608C600E71FEB /* libReactNativePermissions.a in Frameworks */,
299 326
 			);
300 327
 			runOnlyForDeploymentPostprocessing = 0;
301 328
 		};
@@ -303,8 +330,8 @@
303 330
 			isa = PBXFrameworksBuildPhase;
304 331
 			buildActionMask = 2147483647;
305 332
 			files = (
306
-				2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */,
307
-				2D02E4C21E0B4AEC006451C7 /* libRCTAnimation-tvOS.a in Frameworks */,
333
+				2D02E4C91E0B4AEC006451C7 /* libReact-tvOS.a in Frameworks */,
334
+				2D02E4C21E0B4AEC006451C7 /* libRCTAnimation.a in Frameworks */,
308 335
 				2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */,
309 336
 				2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */,
310 337
 				2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */,
@@ -397,6 +424,8 @@
397 424
 			children = (
398 425
 				139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
399 426
 				3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */,
427
+				66F16C001FC608A800E71FEB /* libfishhook.a */,
428
+				66F16C021FC608A800E71FEB /* libfishhook-tvOS.a */,
400 429
 			);
401 430
 			name = Products;
402 431
 			sourceTree = "<group>";
@@ -419,7 +448,6 @@
419 448
 			isa = PBXGroup;
420 449
 			children = (
421 450
 				146834041AC3E56700842450 /* libReact.a */,
422
-				3DAD3EA31DF850E9000B6D8A /* libReact.a */,
423 451
 				3DAD3EA51DF850E9000B6D8A /* libyoga.a */,
424 452
 				3DAD3EA71DF850E9000B6D8A /* libyoga.a */,
425 453
 				3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */,
@@ -435,11 +463,26 @@
435 463
 			isa = PBXGroup;
436 464
 			children = (
437 465
 				5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */,
438
-				5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */,
466
+				5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */,
467
+			);
468
+			name = Products;
469
+			sourceTree = "<group>";
470
+		};
471
+		66F16C031FC608A800E71FEB /* Products */ = {
472
+			isa = PBXGroup;
473
+			children = (
474
+				66F16C071FC608A900E71FEB /* libReactNativePermissions.a */,
439 475
 			);
440 476
 			name = Products;
441 477
 			sourceTree = "<group>";
442 478
 		};
479
+		66F16C081FC608C600E71FEB /* Frameworks */ = {
480
+			isa = PBXGroup;
481
+			children = (
482
+			);
483
+			name = Frameworks;
484
+			sourceTree = "<group>";
485
+		};
443 486
 		78C398B11ACF4ADC00677621 /* Products */ = {
444 487
 			isa = PBXGroup;
445 488
 			children = (
@@ -464,7 +507,7 @@
464 507
 				832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
465 508
 				00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
466 509
 				139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
467
-				1CB53DB705894AAA8CB22783 /* ReactNativePermissions.xcodeproj */,
510
+				0D173517D64E4E0C9D1491B9 /* ReactNativePermissions.xcodeproj */,
468 511
 			);
469 512
 			name = Libraries;
470 513
 			sourceTree = "<group>";
@@ -485,6 +528,7 @@
485 528
 				832341AE1AAA6A7D00B99B32 /* Libraries */,
486 529
 				00E356EF1AD99517003FC87E /* ExampleTests */,
487 530
 				83CBBA001A601CBA00E9B192 /* Products */,
531
+				66F16C081FC608C600E71FEB /* Frameworks */,
488 532
 			);
489 533
 			indentWidth = 2;
490 534
 			sourceTree = "<group>";
@@ -506,6 +550,7 @@
506 550
 			isa = PBXGroup;
507 551
 			children = (
508 552
 				ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */,
553
+				66F16BEE1FC608A800E71FEB /* libRCTBlob-tvOS.a */,
509 554
 			);
510 555
 			name = Products;
511 556
 			sourceTree = "<group>";
@@ -591,16 +636,16 @@
591 636
 		83CBB9F71A601CBA00E9B192 /* Project object */ = {
592 637
 			isa = PBXProject;
593 638
 			attributes = {
594
-				LastUpgradeCheck = 820;
639
+				LastUpgradeCheck = 610;
595 640
 				ORGANIZATIONNAME = Facebook;
596 641
 				TargetAttributes = {
597 642
 					00E356ED1AD99517003FC87E = {
598 643
 						CreatedOnToolsVersion = 6.2;
599
-						DevelopmentTeam = 66SW7BQ2SM;
644
+						DevelopmentTeam = 745449BDR9;
600 645
 						TestTargetID = 13B07F861A680F5B00A75B9A;
601 646
 					};
602 647
 					13B07F861A680F5B00A75B9A = {
603
-						DevelopmentTeam = 66SW7BQ2SM;
648
+						DevelopmentTeam = 745449BDR9;
604 649
 						SystemCapabilities = {
605 650
 							com.apple.BackgroundModes = {
606 651
 								enabled = 1;
@@ -679,8 +724,8 @@
679 724
 					ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
680 725
 				},
681 726
 				{
682
-					ProductGroup = 9D140C9F1F068EB400146F6C /* Products */;
683
-					ProjectRef = 1CB53DB705894AAA8CB22783 /* ReactNativePermissions.xcodeproj */;
727
+					ProductGroup = 66F16C031FC608A800E71FEB /* Products */;
728
+					ProjectRef = 0D173517D64E4E0C9D1491B9 /* ReactNativePermissions.xcodeproj */;
684 729
 				},
685 730
 			);
686 731
 			projectRoot = "";
@@ -848,13 +893,41 @@
848 893
 			remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */;
849 894
 			sourceTree = BUILT_PRODUCTS_DIR;
850 895
 		};
851
-		5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */ = {
896
+		5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */ = {
852 897
 			isa = PBXReferenceProxy;
853 898
 			fileType = archive.ar;
854
-			path = "libRCTAnimation-tvOS.a";
899
+			path = libRCTAnimation.a;
855 900
 			remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */;
856 901
 			sourceTree = BUILT_PRODUCTS_DIR;
857 902
 		};
903
+		66F16BEE1FC608A800E71FEB /* libRCTBlob-tvOS.a */ = {
904
+			isa = PBXReferenceProxy;
905
+			fileType = archive.ar;
906
+			path = "libRCTBlob-tvOS.a";
907
+			remoteRef = 66F16BED1FC608A800E71FEB /* PBXContainerItemProxy */;
908
+			sourceTree = BUILT_PRODUCTS_DIR;
909
+		};
910
+		66F16C001FC608A800E71FEB /* libfishhook.a */ = {
911
+			isa = PBXReferenceProxy;
912
+			fileType = archive.ar;
913
+			path = libfishhook.a;
914
+			remoteRef = 66F16BFF1FC608A800E71FEB /* PBXContainerItemProxy */;
915
+			sourceTree = BUILT_PRODUCTS_DIR;
916
+		};
917
+		66F16C021FC608A800E71FEB /* libfishhook-tvOS.a */ = {
918
+			isa = PBXReferenceProxy;
919
+			fileType = archive.ar;
920
+			path = "libfishhook-tvOS.a";
921
+			remoteRef = 66F16C011FC608A800E71FEB /* PBXContainerItemProxy */;
922
+			sourceTree = BUILT_PRODUCTS_DIR;
923
+		};
924
+		66F16C071FC608A900E71FEB /* libReactNativePermissions.a */ = {
925
+			isa = PBXReferenceProxy;
926
+			fileType = archive.ar;
927
+			path = libReactNativePermissions.a;
928
+			remoteRef = 66F16C061FC608A900E71FEB /* PBXContainerItemProxy */;
929
+			sourceTree = BUILT_PRODUCTS_DIR;
930
+		};
858 931
 		78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {
859 932
 			isa = PBXReferenceProxy;
860 933
 			fileType = archive.ar;
@@ -1010,19 +1083,21 @@
1010 1083
 			isa = XCBuildConfiguration;
1011 1084
 			buildSettings = {
1012 1085
 				BUNDLE_LOADER = "$(TEST_HOST)";
1013
-				DEVELOPMENT_TEAM = 66SW7BQ2SM;
1086
+				DEVELOPMENT_TEAM = 745449BDR9;
1014 1087
 				GCC_PREPROCESSOR_DEFINITIONS = (
1015 1088
 					"DEBUG=1",
1016 1089
 					"$(inherited)",
1017 1090
 				);
1091
+				HEADER_SEARCH_PATHS = (
1092
+					"$(inherited)",
1093
+					"$(SRCROOT)/../node_modules/react-native-permissions",
1094
+				);
1018 1095
 				INFOPLIST_FILE = ExampleTests/Info.plist;
1019 1096
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1020 1097
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1021 1098
 				LIBRARY_SEARCH_PATHS = (
1022 1099
 					"$(inherited)",
1023 1100
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1024
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1025
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1026 1101
 				);
1027 1102
 				OTHER_LDFLAGS = (
1028 1103
 					"-ObjC",
@@ -1038,15 +1113,17 @@
1038 1113
 			buildSettings = {
1039 1114
 				BUNDLE_LOADER = "$(TEST_HOST)";
1040 1115
 				COPY_PHASE_STRIP = NO;
1041
-				DEVELOPMENT_TEAM = 66SW7BQ2SM;
1116
+				DEVELOPMENT_TEAM = 745449BDR9;
1117
+				HEADER_SEARCH_PATHS = (
1118
+					"$(inherited)",
1119
+					"$(SRCROOT)/../node_modules/react-native-permissions",
1120
+				);
1042 1121
 				INFOPLIST_FILE = ExampleTests/Info.plist;
1043 1122
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1044 1123
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1045 1124
 				LIBRARY_SEARCH_PATHS = (
1046 1125
 					"$(inherited)",
1047 1126
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1048
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1049
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1050 1127
 				);
1051 1128
 				OTHER_LDFLAGS = (
1052 1129
 					"-ObjC",
@@ -1063,7 +1140,11 @@
1063 1140
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1064 1141
 				CURRENT_PROJECT_VERSION = 1;
1065 1142
 				DEAD_CODE_STRIPPING = NO;
1066
-				DEVELOPMENT_TEAM = 66SW7BQ2SM;
1143
+				DEVELOPMENT_TEAM = 745449BDR9;
1144
+				HEADER_SEARCH_PATHS = (
1145
+					"$(inherited)",
1146
+					"$(SRCROOT)/../node_modules/react-native-permissions",
1147
+				);
1067 1148
 				INFOPLIST_FILE = Example/Info.plist;
1068 1149
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1069 1150
 				OTHER_LDFLAGS = (
@@ -1071,6 +1152,7 @@
1071 1152
 					"-ObjC",
1072 1153
 					"-lc++",
1073 1154
 				);
1155
+				PRODUCT_BUNDLE_IDENTIFIER = com.react.permissions;
1074 1156
 				PRODUCT_NAME = Example;
1075 1157
 				VERSIONING_SYSTEM = "apple-generic";
1076 1158
 			};
@@ -1081,7 +1163,11 @@
1081 1163
 			buildSettings = {
1082 1164
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1083 1165
 				CURRENT_PROJECT_VERSION = 1;
1084
-				DEVELOPMENT_TEAM = 66SW7BQ2SM;
1166
+				DEVELOPMENT_TEAM = 745449BDR9;
1167
+				HEADER_SEARCH_PATHS = (
1168
+					"$(inherited)",
1169
+					"$(SRCROOT)/../node_modules/react-native-permissions",
1170
+				);
1085 1171
 				INFOPLIST_FILE = Example/Info.plist;
1086 1172
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1087 1173
 				OTHER_LDFLAGS = (
@@ -1089,6 +1175,7 @@
1089 1175
 					"-ObjC",
1090 1176
 					"-lc++",
1091 1177
 				);
1178
+				PRODUCT_BUNDLE_IDENTIFIER = com.react.permissions;
1092 1179
 				PRODUCT_NAME = Example;
1093 1180
 				VERSIONING_SYSTEM = "apple-generic";
1094 1181
 			};
@@ -1106,13 +1193,15 @@
1106 1193
 				DEBUG_INFORMATION_FORMAT = dwarf;
1107 1194
 				ENABLE_TESTABILITY = YES;
1108 1195
 				GCC_NO_COMMON_BLOCKS = YES;
1196
+				HEADER_SEARCH_PATHS = (
1197
+					"$(inherited)",
1198
+					"$(SRCROOT)/../node_modules/react-native-permissions/**",
1199
+				);
1109 1200
 				INFOPLIST_FILE = "Example-tvOS/Info.plist";
1110 1201
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1111 1202
 				LIBRARY_SEARCH_PATHS = (
1112 1203
 					"$(inherited)",
1113 1204
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1114
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1115
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1116 1205
 				);
1117 1206
 				OTHER_LDFLAGS = (
1118 1207
 					"-ObjC",
@@ -1138,13 +1227,15 @@
1138 1227
 				COPY_PHASE_STRIP = NO;
1139 1228
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
1140 1229
 				GCC_NO_COMMON_BLOCKS = YES;
1230
+				HEADER_SEARCH_PATHS = (
1231
+					"$(inherited)",
1232
+					"$(SRCROOT)/../node_modules/react-native-permissions/**",
1233
+				);
1141 1234
 				INFOPLIST_FILE = "Example-tvOS/Info.plist";
1142 1235
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1143 1236
 				LIBRARY_SEARCH_PATHS = (
1144 1237
 					"$(inherited)",
1145 1238
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1146
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1147
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1148 1239
 				);
1149 1240
 				OTHER_LDFLAGS = (
1150 1241
 					"-ObjC",
@@ -1174,8 +1265,6 @@
1174 1265
 				LIBRARY_SEARCH_PATHS = (
1175 1266
 					"$(inherited)",
1176 1267
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1177
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1178
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1179 1268
 				);
1180 1269
 				PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.Example-tvOSTests";
1181 1270
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1201,8 +1290,6 @@
1201 1290
 				LIBRARY_SEARCH_PATHS = (
1202 1291
 					"$(inherited)",
1203 1292
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1204
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1205
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1206 1293
 				);
1207 1294
 				PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.Example-tvOSTests";
1208 1295
 				PRODUCT_NAME = "$(TARGET_NAME)";

+ 1
- 1
example/ios/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme Просмотреть файл

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <Scheme
3
-   LastUpgradeVersion = "0820"
3
+   LastUpgradeVersion = "0620"
4 4
    version = "1.3">
5 5
    <BuildAction
6 6
       parallelizeBuildables = "NO"

+ 1
- 1
example/ios/Example/AppDelegate.m Просмотреть файл

@@ -18,7 +18,7 @@
18 18
 {
19 19
   NSURL *jsCodeLocation;
20 20
 
21
-  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
21
+  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
22 22
 
23 23
   RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
24 24
                                                       moduleName:@"Example"

+ 6
- 0
example/ios/Example/Images.xcassets/Contents.json Просмотреть файл

@@ -0,0 +1,6 @@
1
+{
2
+  "info": {
3
+    "version": 1,
4
+    "author": "xcode"
5
+  }
6
+}

+ 5
- 1
example/ios/Example/Info.plist Просмотреть файл

@@ -4,10 +4,14 @@
4 4
 <dict>
5 5
 	<key>CFBundleDevelopmentRegion</key>
6 6
 	<string>en</string>
7
+	<key>CFBundleDisplayName</key>
8
+	<string>Example</string>
7 9
 	<key>CFBundleExecutable</key>
8 10
 	<string>$(EXECUTABLE_NAME)</string>
9 11
 	<key>CFBundleIdentifier</key>
10
-	<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
12
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13
+	<key>CFBundleInfoDictionaryVersion</key>
14
+	<string>6.0</string>
11 15
 	<key>CFBundleName</key>
12 16
 	<string>$(PRODUCT_NAME)</string>
13 17
 	<key>CFBundlePackageType</key>

+ 7
- 7
example/package.json Просмотреть файл

@@ -3,19 +3,19 @@
3 3
   "version": "0.0.1",
4 4
   "private": true,
5 5
   "scripts": {
6
-    "start": "react-native start",
6
+    "start": "node node_modules/react-native/local-cli/cli.js start",
7 7
     "test": "jest"
8 8
   },
9 9
   "dependencies": {
10
-    "react": "^16.0.0-alpha.12",
11
-    "react-native": "^0.48.4",
10
+    "react": "16.0.0",
11
+    "react-native": "0.50.3",
12 12
     "react-native-permissions": "../"
13 13
   },
14 14
   "devDependencies": {
15
-    "babel-jest": "18.0.0",
16
-    "babel-preset-react-native": "1.9.1",
17
-    "jest": "18.1.0",
18
-    "react-test-renderer": "15.4.2"
15
+    "babel-jest": "21.2.0",
16
+    "babel-preset-react-native": "4.0.0",
17
+    "jest": "21.2.1",
18
+    "react-test-renderer": "16.0.0"
19 19
   },
20 20
   "jest": {
21 21
     "preset": "react-native"