ProtonMail / ios-mail

Secure email that protects your privacy
http://proton.me
GNU General Public License v3.0
1.42k stars 205 forks source link

Allow other apps to open the Proton Mail inbox, instead of just the compose window #75

Open joshuakcockrell opened 8 months ago

joshuakcockrell commented 8 months ago

What we're trying to do

We want to give our users a way to open (deep link into) the Proton Mail inbox. This is used on screens like the following:

Screenshot 2024-01-08 at 9 59 11 AM

The issue

ProtonMail doesn't provide a URL scheme to open the app's inbox. Proton Mail does provide one to open Proton Mail's compose window, but this is confusing for our users because they tap the button and it open's the Proton Mail app, skips over the inbox, and shows a screen to create a new email:

Screenshot 2024-01-08 at 11 32 10 AM

This results in complaints like the following:

Once I select the option to open protonmail it opens the app but automatically opens a new message template which is odd

You can see it's common for mail apps to provide URL schemes that open to the inbox. ProtonMail is the only one on this list that doesn't:

"canary:" // Canary App inbox
"readdle-spark:" // Spark App inbox
"airmail:" // Airmail App inbox
"fastmail:" // Fastmail App inbox
"googlegmail:" // Gmail App inbox
"ms-outlook:" // Outlook App inbox
"ymail:" // Yahoo Mail App inbox
"protonmail:" // Proton Mail App (opens compose window)

Proposed solution

Proton Mail could provide a URL scheme such as protonmail:inbox or protonmail:open?destination=inbox that just opens the app and doesn't show the "compose new email" screen.

joshuakcockrell commented 8 months ago

Looks like an if statement just needs to be added to https://github.com/ProtonMail/ios-mail/blob/7996c1bd9f823d467aad75007fcbe0c24be7d82b/ProtonMail/ProtonMail/ViewControllers/APP/WindowSceneDelegate.swift#L135

Maybe even copy pasting that existing deep link logic but dropping the deeplink.append(DeepLink.Node(name: "toComposeMailto", value: path)) line would work?