Skip to content

Commit 0fc6956

Browse files
committed
Add description of forceCloseOnRedirection
1 parent c1dab7e commit 0fc6956

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ CustomTabs.openURL(url, {
104104
animations: ANIMATIONS_SLIDE, // or ANIMATIONS_FADE
105105
headers: {
106106
'my-custom-header': 'my custom header value'
107-
}
107+
},
108+
forceCloseOnRedirection: true,
108109
});
109110
```
110111

@@ -118,6 +119,8 @@ The option to support:
118119
|enableDefaultShare|boolean|undefined|Whether to add a default shared items of the menu.|
119120
|animations|Object|undefined|Sets the exit and start animations. ANIMATIONS_FADE, ANIMATIONS_SLIDE or custom object with string properties `startEnter`, `startExit`, `endEnter` and `endExit` each defining an Android animation resource ID to use for the animations, such as `com.github.droibit.android.reactnative.customtabs:anim/slide_in_right`.|
120121
|headers|Object|undefined|Sets any custom headers that should be used.|
122+
|forceCloseOnRedirection|boolean|undefined|Workaround that Custom Tabs doesn't close on redirecting back to app scheme.([#11](https://github.com/droibit/react-native-custom-tabs/pull/11))|
123+
121124

122125
`undefined` property is the default behavior of the Custom Tabs.
123126

example/index.android.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ export default class Example extends Component {
7777
enableUrlBarHiding: true,
7878
showPageTitle: true,
7979
enableDefaultShare: true,
80-
animations: ANIMATIONS_SLIDE
80+
animations: ANIMATIONS_SLIDE,
81+
forceCloseOnRedirection: true,
8182
});
8283
}
8384

src/TabOption.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ export type TabOption = {
7575
* Sets any custom headers that should be used.
7676
*/
7777
headers?: Object;
78+
79+
/**
80+
* Workaround that Custom Tabs doesn't close on redirecting back to app scheme.
81+
*/
82+
forceCloseOnRedirection?: boolean;
7883
};
7984

8085

0 commit comments

Comments
 (0)