Skip to content

Commit

Permalink
Merge pull request #277 from proyecto26/develop
Browse files Browse the repository at this point in the history
Release 3.6.0
  • Loading branch information
jdnichollsc committed Jun 26, 2021
2 parents fa2d8e1 + c4733c9 commit 623f34a
Show file tree
Hide file tree
Showing 19 changed files with 308 additions and 7,199 deletions.
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

0 comments on commit 623f34a

Please sign in to comment.