apache / apache/cordova-plugin-inappbrowser
App intents are not supported
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 2.2k
- PR merge metrics
- No merged PRs in 30d
Description
# Bug Report
## Problem
Since changing to WKWebView (mandatory for IOS), apps do not get opened anymore (links with any custom app intent, say whatsapp:// etc)
The inappbrowser gives the error {"code":-1002,"message":"unsupported URL","type":"loaderror"}
### What is expected to happen?
The app should open after clicking a link with their intent.
### What does actually happen?
Nothing, an error is raised (unsupported URL)
## Information
After opening (succesfully) a web page, this page holds buttons that open apps. These buttons dont work anymore.
Note: I am able to use [this ](https://github.com/apache/cordova-plugin-inappbrowser/issues/592#issuecomment-644512070) workaround to add the intent manually in a forked version of the in-app-browser.
I would prefer the solution to use the allowed intents from the cordova-plugin-queries-schemes plugin (or any intent)
### Command or Code
```
const browserOptions = 'location=no,hardwareback=no,toolbar=yes';
const browser = this.iab.create(this.paymentUrl, '_blank', browserOptions);
const listener = browser.on('loadstart').subscribe((event: any) => {
this.logger.debug('browser is opening url ' + event.url);` // log: browser is opening url intentname://bla
}
const errorListener = browser.on('loaderror').subscribe((event: any) => {
this.logger.error('ERROR: ', event); // log: "ERROR: {"code":-1002,"message":"unsupported URL","type":"loaderror",...
}
### Environment, Platform, Device
IOS, cordova Ionic
### Version information
cordova-plugin-inappbrowser 4.0.0
## Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
Contributor guide
Research direction
Start with the iOS WKWebView navigation handling exercised by the browser.on('loadstart') and loaderror events, and compare it with the workaround linked in the report. Done means links using custom app intents such as whatsapp:// open the target app without producing the unsupported URL error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, objective-c
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100