Opening available email clients


#1

I have a similar “magic link” flow as Slack has but I can’t figure out how they managed to have a button that opens the email client, not just that - they show the different email clients I have installed and even show which one is the default one (wow) - how do they do that?

Thanks :slight_smile:


#2

Hi @nirpeled!

You can use the Linking api here: https://docs.expo.io/versions/v27.0.0/sdk/linking

In tandem with the canOpenUrl method from here: https://facebook.github.io/react-native/docs/linking.html#canopenurl

The way this works under the hood: iOS’s URL Schemes (documented here): https://developer.apple.com/library/archive/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html#//apple_ref/doc/uid/TP40007072-CH6-SW1

Here’s a helpful tutorial style post you may like reading. It has code showing url strings to detect each of the major email clients : https://hackernoon.com/ios-email-picker-99045d940a3d


#3

Thanks dude, I’ll check it out :sunglasses:

Any idea if this technique could work on Android as well?


closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.