Skip to content

Commit d203518

Browse files
committed
Update version to 3.4.0
1 parent 4c0ed7c commit d203518

36 files changed

+3997
-3533
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "@react-native-community",
33
"rules": {
4-
"comma-dangle": ["error", {
4+
"comma-dangle": ["error", "always-multiline", {
55
"arrays": "never",
66
"objects": "never",
77
"imports": "never",

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ in case of vulnerabilities.
2222

2323
## [Unreleased]
2424

25+
## [3.4.0] - 2020-04-08
26+
27+
### Added
28+
- Added `ephemeralWebSession` option to supports `ephemeralWebBrowserSession` on iOS 13 by [@avenner](https://github.com/avenner) ([#141](https://github.com/proyecto26/react-native-inappbrowser/pull/141)).
29+
30+
### Fixed
31+
- Remove listener of `openAuth` when `closeAuth` is called.
32+
2533
## [3.3.4] - 2020-01-07
2634

2735
### Fixed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,16 @@ import { getDeepLink } from './utilities'
296296
if (await InAppBrowser.isAvailable()) {
297297
InAppBrowser.openAuth(url, deepLink, {
298298
// iOS Properties
299-
dismissButtonStyle: 'cancel',
300299
ephemeralWebSession: false,
301300
// Android Properties
302301
showTitle: false,
303302
enableUrlBarHiding: true,
304-
enableDefaultShare: true
303+
enableDefaultShare: false
305304
}).then((response) => {
306-
if (response.type === 'success' &&
307-
response.url) {
305+
if (
306+
response.type === 'success' &&
307+
response.url
308+
) {
308309
Linking.openURL(response.url)
309310
}
310311
})

example/.eslintrc.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11
module.exports = {
22
root: true,
33
extends: '@react-native-community',
4-
rules: {
5-
"comma-dangle": ["error", {
6-
"arrays": "never",
7-
"objects": "never",
8-
"imports": "never",
9-
"exports": "never",
10-
"functions": "never"
11-
}],
12-
"prettier/prettier": ["error", {
13-
"endOfLine": "auto",
14-
"singleQuote": true
15-
}]
16-
}
174
};

example/.flowconfig

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55
; Ignore "BUCK" generated dirs
66
<PROJECT_ROOT>/\.buckd/
77

8-
; Ignore unexpected extra "@providesModule"
9-
.*/node_modules/.*/node_modules/fbjs/.*
10-
11-
; Ignore duplicate module providers
12-
; For RN Apps installed via npm, "Libraries" folder is inside
13-
; "node_modules/react-native" but in the source repo it is in the root
14-
node_modules/react-native/Libraries/react-native/React.js
15-
168
; Ignore polyfills
179
node_modules/react-native/Libraries/polyfills/.*
1810

@@ -21,15 +13,15 @@ node_modules/react-native/Libraries/polyfills/.*
2113
node_modules/warning/.*
2214

2315
; Flow doesn't support platforms
24-
.*/Libraries/Utilities/HMRLoadingView.js
16+
.*/Libraries/Utilities/LoadingView.js
2517

2618
[untyped]
2719
.*/node_modules/@react-native-community/cli/.*/.*
2820

2921
[include]
3022

3123
[libs]
32-
node_modules/react-native/Libraries/react-native/react-native-interface.js
24+
node_modules/react-native/interface.js
3325
node_modules/react-native/flow/
3426

3527
[options]
@@ -42,27 +34,10 @@ module.file_ext=.js
4234
module.file_ext=.json
4335
module.file_ext=.ios.js
4436

45-
module.system=haste
46-
module.system.haste.use_name_reducers=true
47-
# get basename
48-
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
49-
# strip .js or .js.flow suffix
50-
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
51-
# strip .ios suffix
52-
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
53-
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
54-
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
55-
module.system.haste.paths.blacklist=.*/__tests__/.*
56-
module.system.haste.paths.blacklist=.*/__mocks__/.*
57-
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
58-
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
59-
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
60-
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation.js
61-
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
62-
6337
munge_underscores=true
6438

65-
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
39+
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
40+
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
6641

6742
suppress_type=$FlowIssue
6843
suppress_type=$FlowFixMe
@@ -96,4 +71,4 @@ untyped-import
9671
untyped-type-import
9772

9873
[version]
99-
^0.98.0
74+
^0.113.0

example/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23-
project.xcworkspace
2423

2524
# Android/IntelliJ
2625
#
@@ -40,6 +39,7 @@ yarn-error.log
4039
buck-out/
4140
\.buckd/
4241
*.keystore
42+
!debug.keystore
4343

4444
# fastlane
4545
#

example/.prettierrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
bracketSpacing: false,
3+
jsxBracketSameLine: true,
4+
singleQuote: true,
5+
trailingComma: 'all',
6+
};

example/App.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* https://github.com/facebook/react-native
44
*
55
* @format
6-
* @flow
6+
* @flow strict-local
77
*/
88

9-
import React, { Component } from 'react';
9+
import React, {Component} from 'react';
1010
import {
1111
Platform,
1212
StyleSheet,
@@ -16,15 +16,15 @@ import {
1616
Alert,
1717
TextInput,
1818
StatusBar,
19-
Linking
19+
Linking,
2020
} from 'react-native';
2121
import InAppBrowser from 'react-native-inappbrowser-reborn';
2222

2323
const instructions = Platform.select({
2424
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
2525
android:
2626
'Double tap R on your keyboard to reload,\n' +
27-
'Shake or press menu button for dev menu'
27+
'Shake or press menu button for dev menu',
2828
});
2929

3030
export default class App extends Component {
@@ -33,16 +33,16 @@ export default class App extends Component {
3333

3434
this.state = {
3535
url: 'https://www.google.com',
36-
statusBarStyle: 'dark-content'
36+
statusBarStyle: 'dark-content',
3737
};
3838
}
3939

4040
sleep(timeout) {
41-
return new Promise(resolve => setTimeout(resolve, timeout));
41+
return new Promise((resolve) => setTimeout(resolve, timeout));
4242
}
4343

4444
async openLink() {
45-
const { url, statusBarStyle } = this.state;
45+
const {url, statusBarStyle} = this.state;
4646
try {
4747
if (await InAppBrowser.isAvailable()) {
4848
// A delay to change the StatusBar when the browser is opened
@@ -73,11 +73,11 @@ export default class App extends Component {
7373
startEnter: 'slide_in_right',
7474
startExit: 'slide_out_left',
7575
endEnter: 'slide_in_left',
76-
endExit: 'slide_out_right'
76+
endExit: 'slide_out_right',
7777
},
7878
headers: {
79-
'my-custom-header': 'my custom header value'
80-
}
79+
'my-custom-header': 'my custom header value',
80+
},
8181
});
8282
// A delay to show an alert when the browser is closed
8383
await this.sleep(800);
@@ -107,13 +107,13 @@ export default class App extends Component {
107107
try {
108108
if (await InAppBrowser.isAvailable()) {
109109
const result = await InAppBrowser.openAuth(url, redirectUrl, {
110-
showTitle: true,
111-
toolbarColor: '#6200EE',
112-
secondaryToolbarColor: 'black',
110+
// iOS Properties
111+
ephemeralWebSession: false,
112+
// Android Properties
113+
showTitle: false,
113114
enableUrlBarHiding: true,
114-
enableDefaultShare: true
115+
enableDefaultShare: false,
115116
});
116-
await this.sleep(800);
117117
Alert.alert('Response', JSON.stringify(result));
118118
} else {
119119
Alert.alert('InAppBrowser is not supported :/');
@@ -124,7 +124,7 @@ export default class App extends Component {
124124
}
125125

126126
render() {
127-
const { statusBarStyle } = this.state;
127+
const {statusBarStyle} = this.state;
128128
return (
129129
<View style={styles.container}>
130130
<StatusBar barStyle={statusBarStyle} />
@@ -134,7 +134,7 @@ export default class App extends Component {
134134
<Text style={styles.instructions}>Type the url</Text>
135135
<TextInput
136136
style={styles.urlInput}
137-
onChangeText={text => this.setState({ url: text })}
137+
onChangeText={(text) => this.setState({url: text})}
138138
value={this.state.url}
139139
/>
140140
<View style={styles.openButton}>
@@ -158,26 +158,26 @@ const styles = StyleSheet.create({
158158
justifyContent: 'center',
159159
alignItems: 'center',
160160
backgroundColor: '#F5FCFF',
161-
padding: 30
161+
padding: 30,
162162
},
163163
welcome: {
164164
fontSize: 20,
165165
textAlign: 'center',
166-
margin: 10
166+
margin: 10,
167167
},
168168
instructions: {
169169
textAlign: 'center',
170170
color: '#333333',
171-
marginBottom: 5
171+
marginBottom: 5,
172172
},
173173
urlInput: {
174174
height: 40,
175175
width: '100%',
176176
borderColor: 'gray',
177-
borderWidth: 1
177+
borderWidth: 1,
178178
},
179179
openButton: {
180180
paddingTop: Platform.OS === 'ios' ? 0 : 20,
181-
paddingBottom: Platform.OS === 'ios' ? 0 : 20
182-
}
181+
paddingBottom: Platform.OS === 'ios' ? 0 : 20,
182+
},
183183
});

example/android/app/build.gradle

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ import com.android.build.OutputFile
1515
* // the name of the generated asset file containing your JS bundle
1616
* bundleAssetName: "index.android.bundle",
1717
*
18-
* // the entry file for bundle generation
18+
* // the entry file for bundle generation. If none specified and
19+
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
20+
* // default. Can be overridden with ENTRY_FILE environment variable.
1921
* entryFile: "index.android.js",
2022
*
2123
* // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
@@ -76,7 +78,7 @@ import com.android.build.OutputFile
7678
*/
7779

7880
project.ext.react = [
79-
entryFile: "index.js"
81+
enableHermes: false, // clean and rebuild if changing
8082
]
8183

8284
apply from: "../../node_modules/react-native/react.gradle"
@@ -97,13 +99,26 @@ def enableSeparateBuildPerCPUArchitecture = false
9799
def enableProguardInReleaseBuilds = false
98100

99101
/**
100-
* Use international variant JavaScriptCore
101-
* International variant includes ICU i18n library and necessary data allowing to use
102-
* e.g. Date.toLocaleString and String.localeCompare that give correct results
103-
* when using with locales other than en-US.
104-
* Note that this variant is about 6MiB larger per architecture than default.
102+
* The preferred build flavor of JavaScriptCore.
103+
*
104+
* For example, to use the international variant, you can use:
105+
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
106+
*
107+
* The international variant includes ICU i18n library and necessary data
108+
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
109+
* give correct results when using with locales other than en-US. Note that
110+
* this variant is about 6MiB larger per architecture than default.
105111
*/
106-
def useIntlJsc = false
112+
def jscFlavor = 'org.webkit:android-jsc:+'
113+
114+
/**
115+
* Whether to enable the Hermes VM.
116+
*
117+
* This should be set on project.ext.react and mirrored here. If it is not set
118+
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
119+
* and the benefits of using Hermes will therefore be sharply reduced.
120+
*/
121+
def enableHermes = project.ext.react.get("enableHermes", false);
107122

108123
android {
109124
compileSdkVersion rootProject.ext.compileSdkVersion
@@ -148,6 +163,14 @@ android {
148163
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
149164
}
150165
}
166+
167+
packagingOptions {
168+
pickFirst "lib/armeabi-v7a/libc++_shared.so"
169+
pickFirst "lib/arm64-v8a/libc++_shared.so"
170+
pickFirst "lib/x86/libc++_shared.so"
171+
pickFirst "lib/x86_64/libc++_shared.so"
172+
}
173+
151174
// applicationVariants are e.g. debug, release
152175
applicationVariants.all { variant ->
153176
variant.outputs.each { output ->
@@ -159,19 +182,36 @@ android {
159182
output.versionCodeOverride =
160183
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
161184
}
185+
162186
}
163187
}
164188
}
165189

166190
dependencies {
167191
implementation fileTree(dir: "libs", include: ["*.jar"])
192+
//noinspection GradleDynamicVersion
168193
implementation "com.facebook.react:react-native:+" // From node_modules
169194

170-
// JSC from node_modules
171-
if (useIntlJsc) {
172-
implementation 'org.webkit:android-jsc-intl:+'
195+
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
196+
197+
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
198+
exclude group:'com.facebook.fbjni'
199+
}
200+
201+
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
202+
exclude group:'com.facebook.flipper'
203+
}
204+
205+
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
206+
exclude group:'com.facebook.flipper'
207+
}
208+
209+
if (enableHermes) {
210+
def hermesPath = "../../node_modules/hermes-engine/android/";
211+
debugImplementation files(hermesPath + "hermes-debug.aar")
212+
releaseImplementation files(hermesPath + "hermes-release.aar")
173213
} else {
174-
implementation 'org.webkit:android-jsc:+'
214+
implementation jscFlavor
175215
}
176216
}
177217

example/android/app/debug.keystore

2.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)