artsy / emission

⚠️ Deprecated repo, moved to artsy/eigen ➡️ React Native Components
http://artsy.github.io/blog/2018/04/17/making-a-components-pod/
MIT License
618 stars 78 forks source link

[MX-141] [MX-144] Adds feedback/privacy request user interface #2038

Closed ashfurrow closed 4 years ago

ashfurrow commented 4 years ago

Also updates to use the new Palette Settings icon (see: https://github.com/artsy/palette/pull/625).

I feel like I have some 'splaining to do on this PR 😅 The iOS email compose API is specific enough to iOS that React Native doesn't support it specifically. The only way to open the email compose sheet is to use React Native's Linking module with a mailto:address@example.com?subject=... URL. Feels weird, but that's fine. The problem is that not all iOS devices are configured with an email account. iOS has a [MFMailComposeViewController canSendMail] method that you can query, but no such method existing in React Native. Instead, you have to .catch() on the promise returned from Linking.openURL(), which felt pretty dirty to me. So I wrote a small native function to use the native MFMailComposeViewController.

Here's the new Privacy Request view:

Screen Shot 2020-01-15 at 15 53 20

Tapping "Privacy Policy" will open this modal:

Screen Shot 2020-01-15 at 15 53 28

Tapping on the other links in the simulator will show this error, because the simulator can't open email compose views. It should open the mail compose view when tapped on devices.

Screen Shot 2020-01-15 at 16 07 21

brainbicycle commented 4 years ago

Instead, you have to .catch() on the promise returned from Linking.openURL(), which felt pretty dirty to me. So I wrote a small native function to use the native MFMailComposeViewController.

Agreed this is much better.

artsyit commented 4 years ago

:rocket: PR was released in v1.21.8 :rocket: