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

App intents are not supported #775

Open
Sroose opened this issue Sep 8, 2020 · 2 comments
Open

App intents are not supported #775

Sroose opened this issue Sep 8, 2020 · 2 comments

Comments

@Sroose
Copy link

Sroose commented Sep 8, 2020

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 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
<preference name="WKWebViewOnly" value="true" />

## 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
Sroose added a commit to Sroose/cordova-plugin-inappbrowser that referenced this issue Sep 8, 2020
@fbrun
Copy link

fbrun commented Sep 24, 2020

Hi,
Same error under latest iOS 14, but with iOS 13, it's work

@fbrun
Copy link

fbrun commented Sep 30, 2020

I have make some tests with different custom schemes : one is open inside the inappbrowser view with a window.open, the other with a window.location.replace.

With the first nothing happen. The 'loadstart' event isn't detected too.
I see also that customscheme event is never used under ios, with cordova-plugin-inappbrowser@4.0.0. It's seem that the window.open in the web site displayed in the inapp web view not function, but i don't know why.

With the second, the event 'loadstart' is sended. As customscheme event is never used under ios, i can test the url to determine if it's a custom scheme in the loadstart event, then open it with iab.create(event.url, '_system') (iab is from '@ionic-native/in-app-browser'. It open successfully the app called.

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

No branches or pull requests

2 participants