diff options
author | Ollie Hsieh <renahlee@outlook.com> | 2023-04-27 07:38:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-27 09:38:28 -0500 |
commit | c8e51a7d48587d977a7c005caeb9a1b215fa0ab5 (patch) | |
tree | bafd67499fc7c484c38f96c2b65d56b5a26b8e9b /src/lib | |
parent | 62b07f93fdfaad750dca5ebaf79706d0d3b36630 (diff) | |
download | voidsky-c8e51a7d48587d977a7c005caeb9a1b215fa0ab5.tar.zst |
Fix Android sharing (#545)
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/sharing.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/sharing.ts b/src/lib/sharing.ts index 95ebf8ee9..b294d7464 100644 --- a/src/lib/sharing.ts +++ b/src/lib/sharing.ts @@ -1,4 +1,4 @@ -import {isNative} from 'platform/detection' +import {isIOS, isAndroid} from 'platform/detection' // import * as Sharing from 'expo-sharing' import Clipboard from '@react-native-clipboard/clipboard' import * as Toast from '../view/com/util/Toast' @@ -11,8 +11,10 @@ import {Share} from 'react-native' * clipboard. */ export async function shareUrl(url: string) { - if (isNative) { - Share.share({url: url}) + if (isAndroid) { + Share.share({message: url}) + } else if (isIOS) { + Share.share({url}) } else { // React Native Share is not supported by web. Web Share API // has increasing but not full support, so default to clipboard |