Cap-go / capacitor-inappbrowser

Capacitor plugin in app browser with urlChangeEvent
MIT License
57 stars 37 forks source link

feat(android): handle opening deeplinks inside webview #108

Closed eljass closed 3 months ago

eljass commented 3 months ago

Handles opening deeplink in another app from the webview. Fix for the issue: #98

When webview tries to navigate to URL scheme which is not handled by browser (something else than http:// or https://) we should try to open it in the corresponding application. If app matching the deepLink schema is not found do nothing and show browser's error page.

Within iOS this seems to be handled already, but it were missing from the Android solution as far as I understood correctly.

Example This example uses deeplink to phone app with URL tel://0401231234

  1. Open inapp-browser to deeplink testing site: https://halgatewood.com/deeplink?link=tel%3A%2F%2F0401231234
    • Browser.openWebView({ url: 'https://halgatewood.com/deeplink?link=tel%3A%2F%2F0401231234', title: 'Deep link test', toolbarType: 'navigation' })
  2. Click link to navigate to it
  3. Phone should open the app associated with the URL scheme "tel://"

https://github.com/Cap-go/capacitor-inappbrowser/assets/7661970/184dcb06-e3b0-467f-ae6b-2fe046193838

riderx commented 3 months ago

Thanks a lot i think your may have forgot the required imports ! The CI is failing to build

websitevirtuoso commented 2 weeks ago

how to use it? where example?

websitevirtuoso commented 2 weeks ago

image