string |
-| **`options`** | SystemBrowserOptions |
+| Param | Type |
+| ----------- | ----------------------------------------------------------------------------------------------- |
+| **`model`** | OpenInSystemBrowserParameterModel |
--------------------
@@ -59,12 +57,12 @@ openInSystemBrowser(url: string, options: SystemBrowserOptions) => void
### openInExternalBrowser(...)
```typescript
-openInExternalBrowser(model: OpenInExternalBrowserParameterModel) => void
+openInExternalBrowser(model: OpenInDefaultParameterModel) => void
```
-| Param | Type |
-| ----------- | --------------------------------------------------------------------------------------------------- |
-| **`model`** | OpenInExternalBrowserParameterModel |
+| Param | Type |
+| ----------- | ----------------------------------------------------------------------------------- |
+| **`model`** | OpenInDefaultParameterModel |
--------------------
@@ -108,15 +106,19 @@ addListener(eventName: 'browserClosed' | 'browserPageLoaded', listenerFunc: () =
#### WebViewOptions
-| Prop | Type |
-| --------------------- | ----------------------------------------------------------------------- |
-| **`showURL`** | boolean |
-| **`showToolBar`** | boolean |
-| **`closeButtonText`** | string |
-| **`toolbarPosition`** | ToolbarPosition |
-| **`leftToRight`** | boolean |
-| **`android`** | AndroidWebViewOptions |
-| **`iOS`** | iOSWebViewOptions |
+| Prop | Type |
+| ------------------------------------- | ----------------------------------------------------------------------- |
+| **`showURL`** | boolean |
+| **`showToolbar`** | boolean |
+| **`clearCache`** | boolean |
+| **`clearSessionCache`** | boolean |
+| **`mediaPlaybackRequiresUserAction`** | boolean |
+| **`closeButtonText`** | string |
+| **`toolbarPosition`** | ToolbarPosition |
+| **`showNavigationButtons`** | boolean |
+| **`leftToRight`** | boolean |
+| **`android`** | AndroidWebViewOptions |
+| **`iOS`** | iOSWebViewOptions |
#### AndroidWebViewOptions
@@ -136,18 +138,26 @@ addListener(eventName: 'browserClosed' | 'browserPageLoaded', listenerFunc: () =
| **`enableViewportScale`** | boolean |
| **`allowInLineMediaPlayback`** | boolean |
| **`keyboardDisplayRequiresUserAction`** | boolean |
-| **`surpressedIncrementalRendering`** | boolean |
+| **`surpressIncrementalRendering`** | boolean |
| **`viewStyle`** | iOSViewStyle |
-| **`animationEffect`** | iOSAnimation |
+| **`animation`** | iOSAnimation |
+
+
+#### OpenInSystemBrowserParameterModel
+
+Defines the options for opening a URL in the syste, browser.
+
+| Prop | Type |
+| ------------- | --------------------------------------------------------------------- |
+| **`options`** | SystemBrowserOptions |
#### SystemBrowserOptions
-| Prop | Type |
-| ---------------- | ----------------------------------------------------------------------------------- |
-| **`showURLBar`** | boolean |
-| **`android`** | AndroidSystemBrowserOptions |
-| **`iOS`** | iOSSystemBrowserOptions |
+| Prop | Type |
+| ------------- | ----------------------------------------------------------------------------------- |
+| **`android`** | AndroidSystemBrowserOptions |
+| **`iOS`** | iOSSystemBrowserOptions |
#### AndroidSystemBrowserOptions
@@ -164,10 +174,10 @@ addListener(eventName: 'browserClosed' | 'browserPageLoaded', listenerFunc: () =
#### AndroidBottomSheet
-| Prop | Type |
-| ------------- | ------------------- |
-| **`height`** | number |
-| **`isFixed`** | number |
+| Prop | Type |
+| ------------- | -------------------- |
+| **`height`** | number |
+| **`isFixed`** | boolean |
#### iOSSystemBrowserOptions
@@ -181,21 +191,20 @@ addListener(eventName: 'browserClosed' | 'browserPageLoaded', listenerFunc: () =
| **`enableReadersMode`** | boolean |
-#### PluginListenerHandle
-
-| Prop | Type |
-| ------------ | ----------------------------------------- |
-| **`remove`** | () => Promise<void> |
-
+#### OpenInDefaultParameterModel
-### Type Aliases
+Defines the options for opening a URL in the external browser and used by the others.
+| Prop | Type |
+| --------- | ------------------- |
+| **`url`** | string |
-#### OpenInExternalBrowserParameterModel
-Defines the options for opening a URL in the external browser.
+#### PluginListenerHandle
-{ url: string; }
+| Prop | Type |
+| ------------ | ----------------------------------------- |
+| **`remove`** | () => Promise<void> |
### Enums
@@ -237,20 +246,12 @@ Defines the options for opening a URL in the external browser.
#### AndroidAnimation
-| Members |
-| ---------------------------------------- |
-| **`FADE_IN`** |
-| **`FADE_OUT`** |
-| **`LINEAR_INTERPOLATION`** |
-| **`ACCELERATE_DECELERATE_INTERPOLATOR`** |
-| **`ACCELERATE_INTERPOLATOR`** |
-| **`ANTICIPATE_INTERPOLATOR`** |
-| **`ANTICIPATE_OVERSHOOT_INTERPOLATOR`** |
-| **`BOUNCE_INTERPOLATOR`** |
-| **`DECELERATE_INTERPOLATOR`** |
-| **`OVERSHOOT_INTERPOLATOR`** |
-| **`SLIDE_IN_LEFT`** |
-| **`SLIDE_OUT_RIGHT`** |
+| Members |
+| --------------------- |
+| **`FADE_IN`** |
+| **`FADE_OUT`** |
+| **`SLIDE_IN_LEFT`** |
+| **`SLIDE_OUT_RIGHT`** |
#### DismissStyle
diff --git a/example-app/src/pages/Home.tsx b/example-app/src/pages/Home.tsx
index 8facfd1..43b2d35 100644
--- a/example-app/src/pages/Home.tsx
+++ b/example-app/src/pages/Home.tsx
@@ -1,5 +1,5 @@
import { IonButton, IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
-import { InAppBrowser } from '@capacitor/os-inappbrowser';
+import { InAppBrowser, SystemBrowserOptions, DefaultSystemBrowserOptions, DefaultAndroidSystemBrowserOptions, DismissStyle, iOSViewStyle, iOSAnimation } from '@capacitor/os-inappbrowser';
import './Home.css';
const Home: React.FC = () => {
@@ -10,6 +10,37 @@ const Home: React.FC = () => {
});
}
+ const openInSystemBrowserWithDefaults = () => {
+ InAppBrowser.openInSystemBrowser({
+ url: "https://www.google.com",
+ options: DefaultSystemBrowserOptions
+ });
+ }
+
+ const openInSystemBrowserWithCustomValues = () => {
+ InAppBrowser.openInSystemBrowser({
+ url: "https://www.asymco.com/",
+ options: {
+ android: DefaultAndroidSystemBrowserOptions,
+ iOS: {
+ closeButtonText: DismissStyle.CANCEL,
+ viewStyle: iOSViewStyle.FORM_SHEET,
+ animationEffect: iOSAnimation.FLIP_HORIZONTAL,
+ enableBarsCollapsing: false,
+ enableReadersMode: true
+ }
+ }
+ });
+ }
+
+ InAppBrowser.addListener('browserClosed', () => {
+ console.log("browser was closed.");
+ });
+
+ InAppBrowser.addListener('browserPageLoaded', () => {
+ console.log("browser was loaded.");
+ });
+
return (
SFSafariVieWController implementation can perform the System Browser routing.
+SWIFT_CLASS("_TtC17OSInAppBrowserLib38OSIABSafariViewControllerRouterAdapter")
+@interface OSIABSafariViewControllerRouterAdapter : NSObject
+- (nonnull instancetype)init SWIFT_UNAVAILABLE;
++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
+@end
+
+@class UIPresentationController;
+
+@interface OSIABSafariViewControllerRouterAdapter (SWIFT_EXTENSION(OSInAppBrowserLib)) SFSafariVieWController implementation can perform the System Browser routing.
+SWIFT_CLASS("_TtC17OSInAppBrowserLib38OSIABSafariViewControllerRouterAdapter")
+@interface OSIABSafariViewControllerRouterAdapter : NSObject
+- (nonnull instancetype)init SWIFT_UNAVAILABLE;
++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
+@end
+
+@class UIPresentationController;
+
+@interface OSIABSafariViewControllerRouterAdapter (SWIFT_EXTENSION(OSInAppBrowserLib)) SFSafariVieWController implementation can perform the System Browser routing.
+SWIFT_CLASS("_TtC17OSInAppBrowserLib38OSIABSafariViewControllerRouterAdapter")
+@interface OSIABSafariViewControllerRouterAdapter : NSObject
+- (nonnull instancetype)init SWIFT_UNAVAILABLE;
++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
+@end
+
+@class UIPresentationController;
+
+@interface OSIABSafariViewControllerRouterAdapter (SWIFT_EXTENSION(OSInAppBrowserLib))