Skip to content

Commit 623f34a

Browse files
authored
Merge pull request #277 from proyecto26/develop
Release 3.6.0
2 parents fa2d8e1 + c4733c9 commit 623f34a

File tree

19 files changed

+308
-7199
lines changed

19 files changed

+308
-7199
lines changed

.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.github/
2+
.vscode/
23
example/
3-
img/
4+
img/

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ in case of vulnerabilities.
2222

2323
## [Unreleased]
2424

25+
## [3.6.0] - 2021-06-25
26+
27+
### Added
28+
- Add `navigationBarColor` and `navigationBarDividerColor` by [@jdnichollsc](https://github.com/jdnichollsc).
29+
- Add try catch block to `Safari View Controller` logic by [@Opstrup](https://github.com/Opstrup) ([#216](https://github.com/proyecto26/react-native-inappbrowser/pull/216)).
30+
31+
### Fixed
32+
- Fix invalid scheme with iOS 14.5 by [@SimonIT](https://github.com/SimonIT) ([#262](https://github.com/proyecto26/react-native-inappbrowser/pull/262)).
33+
- Make InAppBrowserOptions exact typed by [@ronal2do](https://github.com/ronal2do) ([#258](https://github.com/proyecto26/react-native-inappbrowser/pull/258)).
34+
- Fix `openAuth` crashed when going to be closed and then press the cancel button by [@hikouki](https://github.com/hikouki) ([#250](https://github.com/proyecto26/react-native-inappbrowser/pull/250)).
35+
- Import `Alert` component for example code block by [@orcuntuna](https://github.com/orcuntuna) ([#209](https://github.com/proyecto26/react-native-inappbrowser/pull/209)).
36+
2537
## [3.5.1] - 2020-10-16
2638

2739
### Fixed
@@ -175,7 +187,8 @@ Missing tags for previous versions 🤷‍♂
175187
- Fix `EventBusException` on **Android** by [@Almouro](https://github.com/Almouro) ([9cf4cbb](https://github.com/proyecto26/react-native-inappbrowser/commit/9cf4cbb58d55c8b534dabac6791e6a2a5428253f)).
176188

177189

178-
[Unreleased]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.5.1...HEAD
190+
[Unreleased]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.6.0...HEAD
191+
[3.6.0]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.5.1...v3.6.0
179192
[3.5.1]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.5.0...v3.5.1
180193
[3.5.0]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.4.0...v3.5.0
181194
[3.4.0]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.3.4...v3.4.0

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@
3333
<img width="400px" src="https://github.com/proyecto26/react-native-inappbrowser/blob/main/img/inappbrowser.png?raw=true">
3434
</p>
3535

36+
## Demo
37+
38+
Do you want to see this package in action? Check these awesome projects, yay! 🎉
39+
- [MyApp](https://github.com/proyecto26/MyApp) - A template to create awesome Apps easily ⚡️
40+
- [OLIO](https://olioex.com) - Share more. Waste less.
41+
- [Alpe Audio](https://www.alpeaudio.com) - Courses On The Go.
42+
43+
Let us know about your awesome project [here](https://github.com/proyecto26/react-native-inappbrowser/issues/164)! ❤️
44+
3645
## Getting started
3746

3847
`$ npm install react-native-inappbrowser-reborn --save`
@@ -153,6 +162,8 @@ Property | Description
153162
`showTitle` (Boolean) | Sets whether the title should be shown in the custom tab. [`true`/`false`]
154163
`toolbarColor` (String) | Sets the toolbar color. [`gray`/`#808080`]
155164
`secondaryToolbarColor` (String) | Sets the color of the secondary toolbar. [`white`/`#FFFFFF`]
165+
`navigationBarColor` (String) | Sets the navigation bar color. [`gray`/`#808080`]
166+
`navigationBarDividerColor` (String) | Sets the navigation bar divider color. [`white`/`#FFFFFF`]
156167
`enableUrlBarHiding` (Boolean) | Enables the url bar to hide as the user scrolls down on the page. [`true`/`false`]
157168
`enableDefaultShare` (Boolean) | Adds a default share item to the menu. [`true`/`false`]
158169
`animations` (Object) | Sets the start and exit animations. [`{ startEnter, startExit, endEnter, endExit }`]
@@ -165,13 +176,13 @@ Property | Description
165176
### Demo
166177
167178
```javascript
168-
import { Linking } from 'react-native'
179+
import { Linking, Alert } from 'react-native'
169180
import { InAppBrowser } from 'react-native-inappbrowser-reborn'
170181
171182
...
172183
async openLink() {
173184
try {
174-
const url = 'https://www.google.com'
185+
const url = 'https://www.proyecto26.com'
175186
if (await InAppBrowser.isAvailable()) {
176187
const result = await InAppBrowser.open(url, {
177188
// iOS Properties
@@ -188,6 +199,8 @@ import { InAppBrowser } from 'react-native-inappbrowser-reborn'
188199
showTitle: true,
189200
toolbarColor: '#6200EE',
190201
secondaryToolbarColor: 'black',
202+
navigationBarColor: 'black',
203+
navigationBarDividerColor: 'white',
191204
enableUrlBarHiding: true,
192205
enableDefaultShare: true,
193206
forceCloseOnRedirection: false,
@@ -429,6 +442,11 @@ Using in-app browser tabs (like SFAuthenticationSession/ASWebAuthenticationSessi
429442
* **React Native Custom Tabs:** [Chrome Custom Tabs for React Native](https://github.com/droibit/react-native-custom-tabs)
430443
* **React Native Safari View:** [A React Native wrapper for Safari View Controller](https://github.com/naoufal/react-native-safari-view)
431444

445+
## Contributing ✨
446+
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
447+
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated** ❤️.
448+
You can learn more about how you can contribute to this project in the [contribution guide](https://github.com/proyecto26/react-native-inappbrowser/blob/develop/CONTRIBUTING.md).
449+
432450
## Contributors ✨
433451
Please do contribute! Issues and pull requests are welcome.
434452

@@ -473,6 +491,9 @@ The maintainers of InAppBrowser for React Native and thousands of other packages
473491
## Security contact information 🚨
474492
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
475493

494+
## License ⚖️
495+
This repository is available under the [MIT License](https://github.com/proyecto26/react-native-inappbrowser/blob/develop/LICENSE).
496+
476497
## Happy coding 💯
477498
Made with ❤️
478499

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ buildscript {
1212
}
1313

1414
dependencies {
15-
classpath 'com.android.tools.build:gradle:3.5.1'
15+
classpath 'com.android.tools.build:gradle:3.5.4'
1616
}
1717
}
1818
}

android/src/main/AndroidManifest.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
package="com.proyecto26.inappbrowser">
44

55
<uses-permission android:name="android.permission.INTERNET" />
6+
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
67

78
<application>
89
<activity
910
android:name=".ChromeTabsManagerActivity">
1011
</activity>
1112
</application>
13+
<queries>
14+
<intent>
15+
<action android:name="android.support.customtabs.action.CustomTabsService" />
16+
</intent>
17+
</queries>
1218
</manifest>
1319

android/src/main/java/com/proyecto26/inappbrowser/RNInAppBrowser.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public class RNInAppBrowser {
3535
private final static String ERROR_CODE = "InAppBrowser";
3636
private static final String KEY_TOOLBAR_COLOR = "toolbarColor";
3737
private static final String KEY_SECONDARY_TOOLBAR_COLOR = "secondaryToolbarColor";
38+
private static final String KEY_NAVIGATION_BAR_COLOR = "navigationBarColor";
39+
private static final String KEY_NAVIGATION_BAR_DIVIDER_COLOR = "navigationBarDividerColor";
3840
private static final String KEY_ENABLE_URL_BAR_HIDING = "enableUrlBarHiding";
3941
private static final String KEY_SHOW_PAGE_TITLE = "showTitle";
4042
private static final String KEY_DEFAULT_SHARE_MENU_ITEM = "enableDefaultShare";
@@ -79,6 +81,7 @@ public void open(Context context, final ReadableMap options, final Promise promi
7981
}
8082

8183
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
84+
isLightTheme = false;
8285
if (options.hasKey(KEY_TOOLBAR_COLOR)) {
8386
final String colorString = options.getString(KEY_TOOLBAR_COLOR);
8487
try {
@@ -98,6 +101,24 @@ public void open(Context context, final ReadableMap options, final Promise promi
98101
"Invalid secondary toolbar color '" + colorString + "': " + e.getMessage());
99102
}
100103
}
104+
if (options.hasKey(KEY_NAVIGATION_BAR_COLOR)) {
105+
final String colorString = options.getString(KEY_NAVIGATION_BAR_COLOR);
106+
try {
107+
builder.setNavigationBarColor(Color.parseColor(colorString));
108+
} catch (IllegalArgumentException e) {
109+
throw new JSApplicationIllegalArgumentException(
110+
"Invalid navigation bar color '" + colorString + "': " + e.getMessage());
111+
}
112+
}
113+
if (options.hasKey(KEY_NAVIGATION_BAR_DIVIDER_COLOR)) {
114+
final String colorString = options.getString(KEY_NAVIGATION_BAR_DIVIDER_COLOR);
115+
try {
116+
builder.setNavigationBarDividerColor(Color.parseColor(colorString));
117+
} catch (IllegalArgumentException e) {
118+
throw new JSApplicationIllegalArgumentException(
119+
"Invalid navigation bar divider color '" + colorString + "': " + e.getMessage());
120+
}
121+
}
101122
if (options.hasKey(KEY_DEFAULT_SHARE_MENU_ITEM) &&
102123
options.getBoolean(KEY_DEFAULT_SHARE_MENU_ITEM)) {
103124
builder.addDefaultShareMenuItem();

example/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

example/App.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
StatusBar,
1919
Linking,
2020
} from 'react-native';
21-
import { InAppBrowser } from 'react-native-inappbrowser-reborn';
21+
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',
@@ -29,15 +29,15 @@ const instructions = Platform.select({
2929

3030
type ComponentState = {
3131
url: string,
32-
statusBarStyle: string
33-
}
32+
statusBarStyle: string,
33+
};
3434

3535
export default class App extends Component<ComponentState> {
3636
constructor(props) {
3737
super(props);
3838

3939
this.state = {
40-
url: 'https://www.google.com',
40+
url: 'https://www.proyecto26.com',
4141
statusBarStyle: 'dark-content',
4242
};
4343
}
@@ -69,6 +69,8 @@ export default class App extends Component<ComponentState> {
6969
showTitle: true,
7070
toolbarColor: '#6200EE',
7171
secondaryToolbarColor: 'black',
72+
navigationBarColor: 'black',
73+
navigationBarDividerColor: 'white',
7274
enableUrlBarHiding: true,
7375
enableDefaultShare: true,
7476
forceCloseOnRedirection: false,
@@ -85,7 +87,7 @@ export default class App extends Component<ComponentState> {
8587
},
8688
hasBackButton: true,
8789
browserPackage: null,
88-
showInRecents: false
90+
showInRecents: false,
8991
});
9092
// A delay to show an alert when the browser is closed
9193
await this.sleep(800);

example/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ buildscript {
1212
jcenter()
1313
}
1414
dependencies {
15-
classpath("com.android.tools.build:gradle:3.5.3")
15+
classpath("com.android.tools.build:gradle:3.5.4")
1616

1717
// NOTE: Do not place your application dependencies here; they belong
1818
// in the individual module build.gradle files

example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ target 'example' do
1717
#
1818
# Note that if you have use_frameworks! enabled, Flipper will not work and
1919
# you should disable these next few lines.
20-
use_flipper!
20+
use_flipper!({ 'Flipper' => '0.87.0' })
2121
post_install do |installer|
2222
flipper_post_install(installer)
2323
end

0 commit comments

Comments
 (0)