@capgo/capacitor-inappbrowser 8.7.0 → 8.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -98,7 +98,7 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
98
98
  case aware = "AWARE"
99
99
  case fakeVisible = "FAKE_VISIBLE"
100
100
  }
101
- private let pluginVersion: String = "8.7.0"
101
+ private let pluginVersion: String = "8.7.1"
102
102
  public let identifier = "CapgoInAppBrowserPlugin"
103
103
  public let jsName = "CapgoInAppBrowser"
104
104
  public let pluginMethods: [CAPPluginMethod] = [
@@ -190,11 +190,16 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
190
190
  }
191
191
  }
192
192
 
193
- private func dismissNavigationControllerIfPresented(_ navigationController: UINavigationController?) {
194
- guard let navigationController, navigationController.presentingViewController != nil else {
193
+ private func dismissNavigationControllerIfPresented(_ navigationController: UINavigationController?, completion: (() -> Void)? = nil) {
194
+ guard let navigationController else {
195
+ completion?()
196
+ return
197
+ }
198
+ guard navigationController.presentingViewController != nil else {
199
+ completion?()
195
200
  return
196
201
  }
197
- navigationController.dismiss(animated: false)
202
+ navigationController.dismiss(animated: false, completion: completion)
198
203
  }
199
204
 
200
205
  private func unregisterWebView(id: String) {
@@ -446,7 +451,6 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
446
451
  }
447
452
 
448
453
  dismissActiveKeyboard()
449
- dismissNavigationControllerIfPresented(navigationController)
450
454
  navigationController.view.removeFromSuperview()
451
455
  if transparentBackground {
452
456
  makeHostWebViewTransparent(for: id)
@@ -1602,14 +1606,16 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
1602
1606
  }
1603
1607
 
1604
1608
  let transparentBackground = call.getBool("transparentBackground", true)
1605
- webViewController.isLayeredBehind = true
1606
- webViewController.transparentHostBackground = transparentBackground
1607
- guard self.sendNavigationControllerToBack(id: resolvedId, transparentBackground: transparentBackground) else {
1608
- call.reject("Failed to send webview to back")
1609
- return
1609
+ self.dismissNavigationControllerIfPresented(navigationController) {
1610
+ webViewController.isLayeredBehind = true
1611
+ webViewController.transparentHostBackground = transparentBackground
1612
+ guard self.sendNavigationControllerToBack(id: resolvedId, transparentBackground: transparentBackground) else {
1613
+ call.reject("Failed to send webview to back")
1614
+ return
1615
+ }
1616
+ self.setActiveWebView(id: resolvedId, webView: webViewController, navigationController: navigationController)
1617
+ call.resolve()
1610
1618
  }
1611
- self.setActiveWebView(id: resolvedId, webView: webViewController, navigationController: navigationController)
1612
- call.resolve()
1613
1619
  }
1614
1620
  }
1615
1621
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-inappbrowser",
3
- "version": "8.7.0",
3
+ "version": "8.7.1",
4
4
  "description": "Capacitor plugin in app browser",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",