From b523140153c7edbb1931f90351b9a9088c94f771 Mon Sep 17 00:00:00 2001
From: Samuel Newman <mozzius@protonmail.com>
Date: Fri, 6 Jun 2025 00:06:33 +0300
Subject: use method that's actually available on android (#8448)

---
 src/components/PostControls/ShareMenu/ShareMenuItems.tsx | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

(limited to 'src/components/PostControls/ShareMenu/ShareMenuItems.tsx')

diff --git a/src/components/PostControls/ShareMenu/ShareMenuItems.tsx b/src/components/PostControls/ShareMenu/ShareMenuItems.tsx
index 94369fcff..c090c3e2d 100644
--- a/src/components/PostControls/ShareMenu/ShareMenuItems.tsx
+++ b/src/components/PostControls/ShareMenu/ShareMenuItems.tsx
@@ -10,6 +10,7 @@ import {type NavigationProp} from '#/lib/routes/types'
 import {shareText, shareUrl} from '#/lib/sharing'
 import {toShareUrl} from '#/lib/strings/url-helpers'
 import {logger} from '#/logger'
+import {isIOS} from '#/platform/detection'
 import {useProfileShadow} from '#/state/cache/profile-shadow'
 import {useSession} from '#/state/session'
 import * as Toast from '#/view/com/util/Toast'
@@ -61,12 +62,16 @@ let ShareMenuItems = ({
     onShareProp()
   }
 
-  const onCopyLink = () => {
+  const onCopyLink = async () => {
     logger.metric('share:press:copyLink', {}, {statsig: true})
     const url = toShareUrl(href)
-    ExpoClipboard.setUrlAsync(url).then(() =>
-      Toast.show(_(msg`Copied to clipboard`), 'clipboard-check'),
-    )
+    if (isIOS) {
+      // iOS only
+      await ExpoClipboard.setUrlAsync(url)
+    } else {
+      await ExpoClipboard.setStringAsync(url)
+    }
+    Toast.show(_(msg`Copied to clipboard`), 'clipboard-check')
     onShareProp()
   }
 
-- 
cgit 1.4.1

