问题
I've built a PWA using Ionic 4 that had a "Contact" Button with a simple href using the 'mailto:' scheme.
<a href="mailto:example@gmail.com">Contact</a>
This used to open the native Mail app in iOS 12.1 when starting the PWA from homescreen. Since I updated to iOS 12.2 it just opens the PWA internal Safari with a message that Safari can't open links starting with 'mailto:'
I have tried using other URI schemes like 'instagram:' or 'message:' but they all lead to the same problem. The only one that I have found to still be functional when I start my PWA from homescreen is the 'tel:' scheme.
Has anyone else encountered this problem and has any idea how to still open URI schemes other than tel: from a PWA that has been opened from homescreen?
回答1:
I have a PWA which is installed on iOS 12.2, my link uses target="_blank" and it works. Did you try this ?
Have a nice day,
回答2:
I managed to get it working using the below click function. Tested on both Android and iOS PWA.
()=>{
window.location.href = "mailto:support@example.com?subject=" + emailSubject + "&body=" + emailBody
return
}
来源:https://stackoverflow.com/questions/55610036/is-there-a-way-to-use-the-mailto-or-message-scheme-in-a-pwa-in-ios-12-2