After a user in my app registers, they are taken to a static screen until they verify their email. This screen contains a button that when pressed, is supposed to open the IOS mail app. How do I do this in SwiftUI?
I’m aware that I can send an email with UIApplication.shared.open(URL(string: "mailto:..."))
but I’m trying to specifically just open the app. I’ve tried googling but all the tutorials I’ve seen are for sending emails.
2
Answers
Thanks to @CloudBalancing for finding the link. The url to open the mail app is
URL(string: "message://")
.if you have some issues with opening of the email link – probably you need to add addidtional fixes to function
fixToBrowserString()
usage in SwiftUI: