Skip to content
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

Release 3.7.0 #375

Merged
merged 44 commits into from
Jul 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
dbea48f
Avoid stringifying null redirect url
Jul 6, 2021
cf91b3c
Update FUNDING.yml
jdnichollsc Jul 21, 2021
89c256a
Remove deprecated `removeEventListener()` calls
Aug 24, 2021
b05ebde
Made the change backwards-compatible with older RN versions
Oct 14, 2021
f900c4a
chore(android): replaced jCenter with maven
mobileteo Dec 23, 2021
6a75956
Fix StatusBar prop name in README example
rrebase Jan 17, 2022
bffbe99
Export options types
rrebase Jan 17, 2022
2616af1
Merge pull request #324 from rrebase/chore/export-options-types
jdnichollsc Jan 17, 2022
b69e6c4
Merge pull request #322 from rrebase/patch-1
jdnichollsc Jan 17, 2022
278d4b5
Merge pull request #320 from matteodanelli/develop
jdnichollsc Jan 18, 2022
7322e18
Merge pull request #286 from divipayhq/develop
jdnichollsc Jan 18, 2022
e529c1c
IOS: Add custom size option to formSheet Modal
ShaneMckenna23 Feb 24, 2022
dc9139b
Update types
ShaneMckenna23 Feb 24, 2022
29695db
Add new IOS property to ReadMe
ShaneMckenna23 Feb 24, 2022
e9b55f7
Bump minor version
ShaneMckenna23 Feb 24, 2022
e2bbe20
Rename: formSheetContentSize - formSheetPreferredContentSize
ShaneMckenna23 Mar 1, 2022
8035456
Add iPad to prop description
ShaneMckenna23 Mar 1, 2022
727f5fc
Update change log with PR information
ShaneMckenna23 Mar 1, 2022
56a08e4
Remove QUERY_ALL_PACKAGES permission
androideveloper Mar 17, 2022
5adc52d
Merge pull request #335 from androideveloper/patch-1
jdnichollsc Mar 17, 2022
580c0ac
Upgrade build to use sdk 31 instead
vincent-paing Apr 5, 2022
2046857
Merge pull request #340 from vincent-paing/fix/android_12_exported_re…
jdnichollsc Apr 6, 2022
5b7b125
Merge pull request #297 from TheWirv/remove-deprecated-calls
jdnichollsc Apr 7, 2022
6a457bd
Add warmup and mayLaunchUrl function for optimization in Android
vincent-paing Apr 13, 2022
601b3eb
Add documentation on how to warmup the browser process in Android
vincent-paing Apr 13, 2022
83bf3e1
Exclude changes made to build.gradle
vincent-paing Apr 15, 2022
4a3be53
Add includeReferrer to allow adding android package name as referrer …
vincent-paing Apr 15, 2022
5c90325
🔨Upgraded dependency org.greenrobot:eventbus to 3.1.0 due to build is…
chrismerino May 13, 2022
dfeadbc
Merge pull request #347 from chrismerino/upgrade-build-gradle
jdnichollsc May 20, 2022
62d59a8
Merge pull request #342 from vincent-paing/feat/android_referrer
jdnichollsc May 20, 2022
0b942ba
Merge pull request #331 from valtech-sd/develop
jdnichollsc May 20, 2022
3db57a3
Merge branch 'develop' into rework/custom_tab
jdnichollsc May 20, 2022
bbc69b7
Merge pull request #341 from vincent-paing/rework/custom_tab
jdnichollsc May 20, 2022
9893cf0
Update README.md
jdnichollsc May 20, 2022
a288117
Code review
jdnichollsc May 20, 2022
de2e689
Fix redirection logic and update example
jdnichollsc Jul 29, 2022
3ec9320
Improved example project
jdnichollsc Jul 29, 2022
33f63b3
Code review
jdnichollsc Jul 29, 2022
6c0d717
Fix linter issue
jdnichollsc Jul 29, 2022
bf2e2dd
Merge pull request #371 from proyecto26/fix/example
jdnichollsc Jul 29, 2022
9388d05
Update dependencies
jdnichollsc Jul 29, 2022
9cda859
Update CHANGELOG
jdnichollsc Jul 29, 2022
3b29d94
Update README
jdnichollsc Jul 29, 2022
33e1738
Update CHANGELOG.md
jdnichollsc Jul 29, 2022
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
24 changes: 15 additions & 9 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{
"extends": "@react-native-community",
"parser": "@babel/eslint-parser",
"extends": [
"@react-native-community",
"plugin:flowtype/recommended",
"plugin:prettier/recommended"
],
"plugins": [
"flowtype"
],
"rules": {
"comma-dangle": ["error", "always-multiline", {
"arrays": "never",
"objects": "never",
"imports": "never",
"exports": "never",
"functions": "never"
}],
"prettier/prettier": ["error", { "singleQuote": true }]
"prettier/prettier": [
"error",
{
"singleQuote": true
}
]
}
}
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ patreon: proyecto26
open_collective: proyecto26
ko_fi: proyecto26
tidelift: npm/react-native-inappbrowser-reborn
liberapay: jdnichollsc
liberapay: proyecto26
custom: paypal.me/jdnichollsc
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@ in case of vulnerabilities.

## [Unreleased]

## [3.7.0] - 2022-07-29

### Added
- Add custom size option to iOS formSheet Modal by [@ShaneMckenna23](https://github.com/ShaneMckenna23) ([#331](https://github.com/proyecto26/react-native-inappbrowser/pull/331)).
- Add `warmup` and `mayLaunchUrl` functions for optimizati on in Android by [@vincent-paing](https://github.com/vincent-paing) ([#341](https://github.com/proyecto26/react-native-inappbrowser/pull/341)).
- Add `includeReferrer` to allow adding android package name as referrer for website to track by [@vincent-paing](https://github.com/vincent-paing) ([#342](https://github.com/proyecto26/react-native-inappbrowser/pull/342)).

### Changed
- Export options types by [@rrebase](https://github.com/rrebase) ([#324](https://github.com/proyecto26/react-native-inappbrowser/pull/324)).
- Upgrade build configuration to use sdk 31 instead by [@vincent-paing](https://github.com/vincent-paing) ([#340](https://github.com/proyecto26/react-native-inappbrowser/pull/340)).
- Upgraded dependency `org.greenrobot:eventbus` to 3.1.0 due to build issue by [@chrismerino](https://github.com/chrismerino) ([#347](https://github.com/proyecto26/react-native-inappbrowser/pull/347)).

### Fixed
- Avoid stringifying null redirect url by [@rmartin48](https://github.com/rmartin48) ([#286](https://github.com/proyecto26/react-native-inappbrowser/pull/286)).
- Replaced **jCenter** with **Maven** by [@matteodanelli](https://github.com/matteodanelli) ([#320](https://github.com/proyecto26/react-native-inappbrowser/pull/320)).
- Fix **StatusBar** prop name in README example [@rrebase](https://github.com/rrebase) ([#322](https://github.com/proyecto26/react-native-inappbrowser/pull/322)).
- Fix redirection logic and update example project by [@jdnichollsc](https://github.com/jdnichollsc) ([#371](https://github.com/proyecto26/react-native-inappbrowser/pull/371)).

### Removed
- Remove deprecated `removeEventListener()` calls with backward compatibility by [@TheWirv](https://github.com/TheWirv) ([#297](https://github.com/proyecto26/react-native-inappbrowser/pull/297)).
- Remove `QUERY_ALL_PACKAGES` permission by [@androideveloper](https://github.com/androideveloper) ([#335](https://github.com/proyecto26/react-native-inappbrowser/pull/335)).

## [3.6.3] - 2021-07-05

### Fixed
Expand Down Expand Up @@ -202,7 +224,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.6.3...HEAD
[Unreleased]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.7.0...HEAD
[3.7.0]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.6.3...v3.7.0
[3.6.3]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.6.2...v3.6.3
[3.6.2]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.6.1...v3.6.2
[3.6.1]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.6.0...v3.6.1
Expand Down
55 changes: 45 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Do you want to see this package in action? Check these awesome projects, yay!
- [VibePay](https://vibepay.com) - A simple, smarter, better way to get paid.
- [Opinio](https://opinio.media) - Allows the population to be surveyed on social issues.
- [medpex: Online Apotheke](https://www.medpex.de) - Online pharmacy for medicines & cosmetics with over 5 million customers.
- [CONTACT Software](https://www.contact-software.com/) - Energizing your digital business.

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

Expand Down Expand Up @@ -81,10 +82,11 @@ Linking the package manually is not required anymore with [Autolinking](https://
```
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
// Remove 'supportLibVersion' property and put specific versions for AndroidX libraries
androidXAnnotation = "1.2.0"
androidXBrowser = "1.3.0"
Expand Down Expand Up @@ -158,6 +160,7 @@ Property | Description
`modalEnabled` (Boolean) | Present the **SafariViewController** modally or as push instead. [`true`/`false`]
`enableBarCollapsing` (Boolean) | Determines whether the browser's tool bars will collapse or not. [`true`/`false`]
`ephemeralWebSession` (Boolean) | Prevent re-use cookies of previous session (openAuth only) [`true`/`false`]
`formSheetPreferredContentSize` (Object) | Custom size for iPad `formSheet` modals [`{width: 400, height: 500}`]

### Android Options
Property | Description
Expand All @@ -175,6 +178,7 @@ Property | Description
`hasBackButton` (Boolean) | Sets a back arrow instead of the default `X` icon to close the custom tab. [`true`/`false`]
`browserPackage` (String) | Package name of a browser to be used to handle Custom Tabs.
`showInRecents` (Boolean) | Determining whether browsed website should be shown as separate entry in Android recents/multitasking view. [`true`/`false`]
`includeReferrer` (Boolean) | Determining whether to include your package name as referrer for the website to track. [`true`/`false`]

### Demo

Expand All @@ -183,9 +187,12 @@ import { Linking, Alert } from 'react-native'
import { InAppBrowser } from 'react-native-inappbrowser-reborn'

...
async sleep(timeout) {
return new Promise(resolve => setTimeout(resolve, timeout))
}
async openLink() {
try {
const url = 'https://www.proyecto26.com'
const url = 'https://github.com/proyecto26'
if (await InAppBrowser.isAvailable()) {
const result = await InAppBrowser.open(url, {
// iOS Properties
Expand Down Expand Up @@ -219,6 +226,7 @@ import { InAppBrowser } from 'react-native-inappbrowser-reborn'
'my-custom-header': 'my custom header value'
}
})
await this.sleep(800);
Alert.alert(JSON.stringify(result))
}
else Linking.openURL(url)
Expand All @@ -229,6 +237,33 @@ import { InAppBrowser } from 'react-native-inappbrowser-reborn'
...
```

### Android Optimizations

On Android, you can warmup the in app browser client to make it launch siginificantly faster. To do so, add the following to your `MainActivity`

```java
import com.proyecto26.inappbrowser.RNInAppBrowserModule;

public class MainActivity extends ReactActivity {

@Override
protected void onStart() {
super.onStart();
RNInAppBrowserModule.onStart(this);
}

}
```

You can further optimize performance and pre-render pages [by providing the urls that the user is likely to open](https://developer.chrome.com/docs/android/custom-tabs/best-practices/#pre-render-content).

```javascript
// Do not call this every time the component render
useEffect(() => {
InAppBrowser.mayLaunchUrl("Url user has high chance to open", ["Other urls that user might open ordered by priority"]);
}, []);
```

### Authentication Flow using Deep Linking

In order to redirect back to your application from a web browser, you must specify a unique URI to your app. To do this,
Expand Down Expand Up @@ -268,7 +303,7 @@ define your app scheme and replace `my-scheme` and `my-host` with your info.
- utilities.js
```javascript
import { Platform } from 'react-native'
export const getDeepLink = (path = "") => {
export const getDeepLink = (path = '') => {
const scheme = 'my-scheme'
const prefix = Platform.OS == 'android' ? `${scheme}://my-host/` : `${scheme}://`
return prefix + path
Expand Down Expand Up @@ -314,7 +349,7 @@ import { InAppBrowser } from 'react-native-inappbrowser-reborn'
import { getDeepLink } from './utilities'
...
async onLogin() {
const deepLink = getDeepLink("callback")
const deepLink = getDeepLink('callback)
const url = `https://my-auth-login-page.com?redirect_uri=${deepLink}`
try {
if (await InAppBrowser.isAvailable()) {
Expand Down Expand Up @@ -390,7 +425,7 @@ Starting with React Native 0.59 onwards, there is a simpler way of handling this
```javascript
async openInBrowser(url) {
try {
const oldStyle = StatusBar.pushStackEntry({ barStyle: 'dark-content', animate: false });
const oldStyle = StatusBar.pushStackEntry({ barStyle: 'dark-content', animated: false });
await InAppBrowser.open(url)
StatusBar.popStackEntry(oldStyle);
} catch (error) {
Expand Down Expand Up @@ -450,8 +485,8 @@ Using in-app browser tabs (like SFAuthenticationSession/ASWebAuthenticationSessi
* **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** ❤️.
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 ✨
Expand Down
10 changes: 5 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
if (project == rootProject) {
repositories {
maven { url "https://maven.google.com" }
jcenter()
mavenCentral()
google()
}

Expand All @@ -21,10 +21,10 @@ def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

def DEFAULT_COMPILE_SDK_VERSION = 28
def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3"
def DEFAULT_COMPILE_SDK_VERSION = 31
def DEFAULT_BUILD_TOOLS_VERSION = "31.0.0"
def DEFAULT_MIN_SDK_VERSION = 16
def DEFAULT_TARGET_SDK_VERSION = 28
def DEFAULT_TARGET_SDK_VERSION = 31

android {
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
Expand All @@ -51,7 +51,7 @@ repositories {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.facebook.react:react-native:+'
implementation 'org.greenrobot:eventbus:3.+'
implementation 'org.greenrobot:eventbus:3.1.0'
def supportLibVersion = safeExtGet('supportLibVersion', safeExtGet('supportVersion', null))
def androidXVersion = safeExtGet('androidXVersion', null)
if (supportLibVersion && androidXVersion == null) {
Expand Down
6 changes: 3 additions & 3 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
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">
android:name=".ChromeTabsManagerActivity"
android:exported="false">
</activity>
</application>
<queries>
Expand All @@ -16,4 +16,4 @@
</intent>
</queries>
</manifest>


Loading