You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/10/25 16:05:06 UTC

[GitHub] [cordova-plugin-inappbrowser] davidrodma commented on issue #830: Can't open mailto: / tel: / sms: links in IAB under iOS: URL not supported

davidrodma commented on issue #830:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/830#issuecomment-951076119


   > 
   > 
   > I have a solution to this in our Angular 10 Capacitor App. This should work in vanilla cordova apps too. Just using `InAppBrowser.open(...)` did not work for us at all, which is no surprise. InAppBrowser cannot handle action links properly, so why open it with InAppBrowser?
   > 
   > But hooking into beforeload and opening the links with window.open did work for us.
   > 
   > ```ts
   >     const browser = this.iab.create(url, '_blank', this.options);
   > 
   >     browser.on('beforeload').subscribe((event) => {
   > 
   >       // Check if event url is an action link
   >       if (event.url.startsWith('tel:') || event.url.startsWith('mailto:')) {
   >         console.log('Found an action link! ' + event.url);
   >         window.open(event.url, '_system');
   >         return;
   >       }
   >       // more workarounds
   >       ...
   >       // Nothing from above applies. Continue loading
   >       console.log('Beforeload released. Continue loading ' + event.url);
   >       browser._loadAfterBeforeload(event.url);
   >     });
   > ```
   > 
   > I hope this helps anyone!
   
   Save **JensUweB**!!!
   Thank You!
   Just a note, beforeload parameter in options has it set to 'yes'


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org