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

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

Merged
merged 3 commits into from
Mar 20, 2024

Conversation

eljass
Copy link
Contributor

@eljass eljass commented Mar 20, 2024

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://"
Screen_Recording_20240320_131511_Phone.mp4

Handles opening deeplink in another app from the webview
@riderx
Copy link
Contributor

riderx commented Mar 20, 2024

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

@riderx riderx merged commit 7bb1625 into Cap-go:main Mar 20, 2024
6 checks passed
@websitevirtuoso
Copy link

how to use it? where example?

@websitevirtuoso
Copy link

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants