Skip to content

Release 3.6.0 #277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Jun 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7a3392d
Avoid publishing .vscode folder
jdnichollsc Oct 16, 2020
412704c
Update README.md
jdnichollsc Oct 18, 2020
0549ebd
Update README.md
jdnichollsc Oct 27, 2020
28ac30d
import Alert component for example code block
orcuntuna Oct 28, 2020
f82dccb
Merge pull request #209 from orcuntuna/patch-1
jdnichollsc Oct 30, 2020
68a95d2
Add try catch block to Safari View Controller logic
Nov 27, 2020
af3dee2
Update README.md
jdnichollsc Jan 22, 2021
58eae09
Bump y18n from 4.0.0 to 4.0.1
dependabot[bot] Mar 31, 2021
62656f4
fix: issue-186 openAuth crashed when going to be closed and then pres…
hikouki Apr 7, 2021
309cd4d
fix: indent.
hikouki Apr 7, 2021
7b34bca
Merge pull request #250 from hikouki/fix-issue-186
jdnichollsc Apr 7, 2021
e37b2fb
Code review
jdnichollsc Apr 7, 2021
c0c5464
Make InAppBrowserOptions exact typed
ronal2do May 3, 2021
10fe223
Bump ua-parser-js from 0.7.22 to 0.7.28
dependabot[bot] May 7, 2021
888f8c7
Fix invalid scheme with iOS 14.5
SimonIT May 10, 2021
991d72c
Bump lodash from 4.17.20 to 4.17.21
dependabot[bot] May 10, 2021
b35ef11
Use only scheme
SimonIT Jun 2, 2021
a5766b9
Bump glob-parent from 5.1.1 to 5.1.2
dependabot[bot] Jun 10, 2021
1e4c489
Merge pull request #262 from SimonIT/fix-invalid-scheme-error
jdnichollsc Jun 25, 2021
a280fc4
Merge pull request #216 from Opstrup/malformed-url-throws
jdnichollsc Jun 25, 2021
9ebec41
Merge pull request #258 from ronal2do/make-InAppBrowserOptions-exact-…
jdnichollsc Jun 25, 2021
34d3a9d
Merge pull request #260 from proyecto26/dependabot/npm_and_yarn/ua-pa…
jdnichollsc Jun 25, 2021
b05e864
Merge pull request #263 from proyecto26/dependabot/npm_and_yarn/lodas…
jdnichollsc Jun 25, 2021
7340026
Merge pull request #249 from proyecto26/dependabot/npm_and_yarn/y18n-…
jdnichollsc Jun 25, 2021
097e459
Merge pull request #274 from proyecto26/dependabot/npm_and_yarn/glob-…
jdnichollsc Jun 25, 2021
74374e8
feat(android): Add navigationBarColor and navigationBarDividerColor o…
jdnichollsc Jun 26, 2021
ee31fad
Update version to 3.6.0
jdnichollsc Jun 26, 2021
62d912b
Code review
jdnichollsc Jun 26, 2021
01d9d02
Code review
jdnichollsc Jun 26, 2021
ae8aa7b
Code review
jdnichollsc Jun 26, 2021
c4733c9
Fix date release
jdnichollsc Jun 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.github/
.vscode/
example/
img/
img/
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ in case of vulnerabilities.

## [Unreleased]

## [3.6.0] - 2021-06-25

### Added
- Add `navigationBarColor` and `navigationBarDividerColor` by [@jdnichollsc](https://github.com/jdnichollsc).
- 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)).

### Fixed
- Fix invalid scheme with iOS 14.5 by [@SimonIT](https://github.com/SimonIT) ([#262](https://github.com/proyecto26/react-native-inappbrowser/pull/262)).
- Make InAppBrowserOptions exact typed by [@ronal2do](https://github.com/ronal2do) ([#258](https://github.com/proyecto26/react-native-inappbrowser/pull/258)).
- 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)).
- Import `Alert` component for example code block by [@orcuntuna](https://github.com/orcuntuna) ([#209](https://github.com/proyecto26/react-native-inappbrowser/pull/209)).

## [3.5.1] - 2020-10-16

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


[Unreleased]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.5.1...HEAD
[Unreleased]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.6.0...HEAD
[3.6.0]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.5.1...v3.6.0
[3.5.1]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.5.0...v3.5.1
[3.5.0]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.4.0...v3.5.0
[3.4.0]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.3.4...v3.4.0
Expand Down
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@
<img width="400px" src="https://github.com/proyecto26/react-native-inappbrowser/blob/main/img/inappbrowser.png?raw=true">
</p>

## Demo

Do you want to see this package in action? Check these awesome projects, yay! 🎉
- [MyApp](https://github.com/proyecto26/MyApp) - A template to create awesome Apps easily ⚡️
- [OLIO](https://olioex.com) - Share more. Waste less.
- [Alpe Audio](https://www.alpeaudio.com) - Courses On The Go.

Let us know about your awesome project [here](https://github.com/proyecto26/react-native-inappbrowser/issues/164)! ❤️

## Getting started

`$ npm install react-native-inappbrowser-reborn --save`
Expand Down Expand Up @@ -153,6 +162,8 @@ Property | Description
`showTitle` (Boolean) | Sets whether the title should be shown in the custom tab. [`true`/`false`]
`toolbarColor` (String) | Sets the toolbar color. [`gray`/`#808080`]
`secondaryToolbarColor` (String) | Sets the color of the secondary toolbar. [`white`/`#FFFFFF`]
`navigationBarColor` (String) | Sets the navigation bar color. [`gray`/`#808080`]
`navigationBarDividerColor` (String) | Sets the navigation bar divider color. [`white`/`#FFFFFF`]
`enableUrlBarHiding` (Boolean) | Enables the url bar to hide as the user scrolls down on the page. [`true`/`false`]
`enableDefaultShare` (Boolean) | Adds a default share item to the menu. [`true`/`false`]
`animations` (Object) | Sets the start and exit animations. [`{ startEnter, startExit, endEnter, endExit }`]
Expand All @@ -165,13 +176,13 @@ Property | Description
### Demo

```javascript
import { Linking } from 'react-native'
import { Linking, Alert } from 'react-native'
import { InAppBrowser } from 'react-native-inappbrowser-reborn'

...
async openLink() {
try {
const url = 'https://www.google.com'
const url = 'https://www.proyecto26.com'
if (await InAppBrowser.isAvailable()) {
const result = await InAppBrowser.open(url, {
// iOS Properties
Expand All @@ -188,6 +199,8 @@ import { InAppBrowser } from 'react-native-inappbrowser-reborn'
showTitle: true,
toolbarColor: '#6200EE',
secondaryToolbarColor: 'black',
navigationBarColor: 'black',
navigationBarDividerColor: 'white',
enableUrlBarHiding: true,
enableDefaultShare: true,
forceCloseOnRedirection: false,
Expand Down Expand Up @@ -429,6 +442,11 @@ Using in-app browser tabs (like SFAuthenticationSession/ASWebAuthenticationSessi
* **React Native Custom Tabs:** [Chrome Custom Tabs for React Native](https://github.com/droibit/react-native-custom-tabs)
* **React Native Safari View:** [A React Native wrapper for Safari View Controller](https://github.com/naoufal/react-native-safari-view)

## Contributing ✨
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.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated** ❤️.
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).

## Contributors ✨
Please do contribute! Issues and pull requests are welcome.

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

## License ⚖️
This repository is available under the [MIT License](https://github.com/proyecto26/react-native-inappbrowser/blob/develop/LICENSE).

## Happy coding 💯
Made with ❤️

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.android.tools.build:gradle:3.5.4'
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
package="com.proyecto26.inappbrowser">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

<application>
<activity
android:name=".ChromeTabsManagerActivity">
</activity>
</application>
<queries>
<intent>
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent>
</queries>
</manifest>

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class RNInAppBrowser {
private final static String ERROR_CODE = "InAppBrowser";
private static final String KEY_TOOLBAR_COLOR = "toolbarColor";
private static final String KEY_SECONDARY_TOOLBAR_COLOR = "secondaryToolbarColor";
private static final String KEY_NAVIGATION_BAR_COLOR = "navigationBarColor";
private static final String KEY_NAVIGATION_BAR_DIVIDER_COLOR = "navigationBarDividerColor";
private static final String KEY_ENABLE_URL_BAR_HIDING = "enableUrlBarHiding";
private static final String KEY_SHOW_PAGE_TITLE = "showTitle";
private static final String KEY_DEFAULT_SHARE_MENU_ITEM = "enableDefaultShare";
Expand Down Expand Up @@ -79,6 +81,7 @@ public void open(Context context, final ReadableMap options, final Promise promi
}

CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
isLightTheme = false;
if (options.hasKey(KEY_TOOLBAR_COLOR)) {
final String colorString = options.getString(KEY_TOOLBAR_COLOR);
try {
Expand All @@ -98,6 +101,24 @@ public void open(Context context, final ReadableMap options, final Promise promi
"Invalid secondary toolbar color '" + colorString + "': " + e.getMessage());
}
}
if (options.hasKey(KEY_NAVIGATION_BAR_COLOR)) {
final String colorString = options.getString(KEY_NAVIGATION_BAR_COLOR);
try {
builder.setNavigationBarColor(Color.parseColor(colorString));
} catch (IllegalArgumentException e) {
throw new JSApplicationIllegalArgumentException(
"Invalid navigation bar color '" + colorString + "': " + e.getMessage());
}
}
if (options.hasKey(KEY_NAVIGATION_BAR_DIVIDER_COLOR)) {
final String colorString = options.getString(KEY_NAVIGATION_BAR_DIVIDER_COLOR);
try {
builder.setNavigationBarDividerColor(Color.parseColor(colorString));
} catch (IllegalArgumentException e) {
throw new JSApplicationIllegalArgumentException(
"Invalid navigation bar divider color '" + colorString + "': " + e.getMessage());
}
}
if (options.hasKey(KEY_DEFAULT_SHARE_MENU_ITEM) &&
options.getBoolean(KEY_DEFAULT_SHARE_MENU_ITEM)) {
builder.addDefaultShareMenuItem();
Expand Down
1 change: 1 addition & 0 deletions example/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
12 changes: 7 additions & 5 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
StatusBar,
Linking,
} from 'react-native';
import { InAppBrowser } from 'react-native-inappbrowser-reborn';
import {InAppBrowser} from 'react-native-inappbrowser-reborn';

const instructions = Platform.select({
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
Expand All @@ -29,15 +29,15 @@ const instructions = Platform.select({

type ComponentState = {
url: string,
statusBarStyle: string
}
statusBarStyle: string,
};

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

this.state = {
url: 'https://www.google.com',
url: 'https://www.proyecto26.com',
statusBarStyle: 'dark-content',
};
}
Expand Down Expand Up @@ -69,6 +69,8 @@ export default class App extends Component<ComponentState> {
showTitle: true,
toolbarColor: '#6200EE',
secondaryToolbarColor: 'black',
navigationBarColor: 'black',
navigationBarDividerColor: 'white',
enableUrlBarHiding: true,
enableDefaultShare: true,
forceCloseOnRedirection: false,
Expand All @@ -85,7 +87,7 @@ export default class App extends Component<ComponentState> {
},
hasBackButton: true,
browserPackage: null,
showInRecents: false
showInRecents: false,
});
// A delay to show an alert when the browser is closed
await this.sleep(800);
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.3")
classpath("com.android.tools.build:gradle:3.5.4")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ target 'example' do
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!
use_flipper!({ 'Flipper' => '0.87.0' })
post_install do |installer|
flipper_post_install(installer)
end
Expand Down
Loading