Skip to content

Commit 845b352

Browse files
authored
fix: address Expo 44 incompatibility (#44)
Peer dependencies were updated to identify more recent versions of React Native as being compatible, and removed React Native for Windows entirely as a peer dependency. Additional updates include: 1. Update package description 2. Update author and contributor details in `package.json` 3. Updates to project README file
1 parent 2887433 commit 845b352

File tree

3 files changed

+59
-52
lines changed

3 files changed

+59
-52
lines changed

Diff for: README.md

+46-44
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
A native library to access all the native code's build configurations from JS.
44

5-
65
For **[email protected]+** versions use **[email protected]+**
7-
(Autolinking support enabled now)
6+
(autolinking support enabled now).
87

8+
🚨 Seeking help maintaining `react-native-windows` compatibility. See [below](#windows-beta).
99

1010
## Installation
1111

1212
For **rn 0.60+ Auto Linking** will do things for you.
1313

14-
If not follow these:
14+
If not, follow these:
1515

1616
1. `$ npm install react-native-config-reader --save` or `$ yarn add react-native-config-reader`
1717

@@ -24,13 +24,12 @@ If not follow these:
2424
See [manual installation](#manual-installation) below if you have issues with `react-native link`.
2525

2626
## Usage
27+
2728
```javascript
2829
import RNConfigReader from 'react-native-config-reader';
2930

30-
// access any of the defined config variables in andoird build gradle or ios info.plist
31+
// access any of the defined config variables in Android build gradle or iOS info.plist
3132
const configValue = RNConfigReader.ANY_DEFINED_CONFIG_FIELD;
32-
33-
3433
```
3534

3635
### More examples
@@ -44,86 +43,86 @@ android {
4443
applicationId "com.react-native.react-native-config-reader"
4544
versionCode 1
4645
versionName "1.0"
47-
46+
4847
buildConfigField "String", "TEST_CONFIG_FIELD", "Hello I'm your test config value"
4948
}
5049
}
51-
5250
```
51+
5352
Create new field inside ios `info.plist` file
5453

5554
```xml
5655
<?xml version="1.0" encoding="UTF-8"?>
5756
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
5857

59-
<plist version="1.0">
58+
<plist version="1.0">
6059
<dict>
61-
<key>CFBundleDisplayName</key>
62-
<string>com.react-native.react-native-config-reader</string>
63-
64-
<key>TEST_CONFIG_FIELD</key>
65-
<string>"Hello I'm your test config value"</string>
60+
<key>CFBundleDisplayName</key>
61+
<string>com.react-native.react-native-config-reader</string>
62+
63+
<key>TEST_CONFIG_FIELD</key>
64+
<string>"Hello I'm your test config value"</string>
6665
</dict>
6766
</plist>
68-
69-
7067
```
7168

72-
Now you can acess them inside the JS code
69+
Now you can access them inside the JS code:
7370

7471
```javascript
7572
import { Platform } from 'react-native';
7673
import RNConfigReader from 'react-native-config-reader';
7774

78-
if(Platform.OS === 'ios') {
75+
if (Platform.OS === 'ios') {
7976
const iosBundleDisplayName = RNConfigReader.CFBundleDisplayName;
8077
const testConfigValue = RNConfigReader.TEST_CONFIG_FIELD;
8178
}
8279

83-
if(Platform.OS === 'android') {
80+
if (Platform.OS === 'android') {
8481
const androidApplicationID = RNConfigReader.applicationId;
8582
const testConfigValue = RNConfigReader.TEST_CONFIG_FIELD;
8683
}
87-
88-
8984
```
9085

9186
## Manual installation
9287

93-
94-
#### iOS
88+
### iOS
9589

9690
1. In XCode, in the project navigator, right click `Libraries``Add Files to [your project's name]`
9791
2. Go to `node_modules``react-native-config-reader` and add `RNConfigReader.xcodeproj`
9892
3. In XCode, in the project navigator, select your project. Add `libRNConfigReader.a` to your project's `Build Phases``Link Binary With Libraries`
99-
4. Run your project (`Cmd+R`)<
93+
4. Run your project (`Cmd+R`)
10094

101-
#### Android
95+
### Android
10296

10397
1. Open up `android/app/src/main/java/[...]/MainApplication.java`
98+
10499
- Add `import com.reactlibrary.RNConfigReaderPackage;` to the imports at the top of the file
105100
- Add `new RNConfigReaderPackage()` to the list returned by the `getPackages()` method
106-
2. Append the following lines to `android/settings.gradle`:
107-
```
108-
include ':react-native-config-reader'
109-
project(':react-native-config-reader').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config-reader/android')
110-
```
111-
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
112-
```
113-
compile project(':react-native-config-reader')
114-
```
115-
116-
##### Android advanced configurations with Multiple environments
117101

118-
If your app uses an `applicationIdSuffix` or a different `applicationId` depending on the build variants, you must append the following line inside the `buildTypes` block in your `android/app/build.gradle` file and specify your new package name.
102+
1. Append the following lines to `android/settings.gradle`:
103+
104+
```gradle
105+
include ':react-native-config-reader'
106+
project(':react-native-config-reader').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config-reader/android')
107+
```
119108

109+
1. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
110+
111+
```gradle
112+
compile project(':react-native-config-reader')
120113
```
114+
115+
#### Android advanced configurations with Multiple environments
116+
117+
If your app uses an `applicationIdSuffix` or a different `applicationId` depending on the build variants, you must append the following line inside the `buildTypes` block in your `android/app/build.gradle` file and specify your new package name.
118+
119+
```gradle
121120
resValue "string", "rn_config_reader_custom_package", "com.yourNewPackage"
122121
```
123122

124123
Example
125124

126-
```
125+
```gradle
127126
buildTypes {
128127
...
129128
debug {
@@ -134,11 +133,16 @@ buildTypes {
134133
}
135134
```
136135

137-
#### Windows (Beta)
138-
[Read it!](https://github.com/ReactWindows/react-native)
136+
### Windows (Beta)
137+
138+
🚨 When this project was first created in early 2019, it offered support for a beta version of [React Native for Windows](https://github.com/microsoft/react-native-windows). Since this time, many updates have been published to both `react-native` and `react-native-windows`, with no active updates in this project to ensure compatibility.
139+
140+
🙏 If you're interested in using this library with `react-native-windows`, and can offer assistance maintaining it, please reach out to the maintainers by filing an issue.
139141

140142
1. In Visual Studio add the `RNConfigReader.sln` in `node_modules/react-native-config-reader/windows/RNConfigReader.sln` folder to their solution, reference from their app.
141-
2. Open up your `MainPage.cs` app
143+
144+
1. Open up your `MainPage.cs` app
145+
142146
- Add `using Config.Reader.RNConfigReader;` to the usings at the top of the file
143147
- Add `new RNConfigReaderPackage()` to the `List<IReactPackage>` returned by the `Packages` method
144148

@@ -156,10 +160,8 @@ If using Dexguard, the shrinking phase will remove resources it thinks are unuse
156160

157161
`-keepresources string/rn_config_reader_custom_package`
158162

159-
160163
## License
164+
161165
MIT License
162166

163167
Copyright (c) 2019 Chanaka Athurugiriya
164-
165-

Diff for: ios/RNConfigReader.h

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
#if __has_include("RCTBridgeModule.h")
2-
#import "RCTBridgeModule.h"
3-
#else
41
#import <React/RCTBridgeModule.h>
5-
#endif
62

73
@interface RNConfigReader : NSObject <RCTBridgeModule>
84

Diff for: package.json

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-config-reader",
3-
"version": "4.2.0",
4-
"description": "Simply access android build configs and ios info.plist values in JS",
3+
"version": "5.0.0",
4+
"description": "Simply access Android build configs and iOS info.plist values in JS",
55
"main": "index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1"
@@ -12,10 +12,19 @@
1212
"ios",
1313
"config-reader"
1414
],
15-
"author": "csath - [email protected]",
15+
"author": {
16+
"name": "Chanaka Athurugiriya",
17+
"email": "[email protected]"
18+
},
19+
"contributors": [
20+
{
21+
"name": "John Lianoglou",
22+
"email": "[email protected]"
23+
}
24+
],
1625
"license": "MIT",
1726
"peerDependencies": {
18-
"react-native": "^0.41.2 || ^0.60.0 || ^0.61.0 || ^0.63.0 || ^0.64.0 || ^0.65.0 || ^0.66.0"
27+
"react-native": "^0.61.0"
1928
},
2029
"repository": {
2130
"type": "git",

0 commit comments

Comments
 (0)