Fix Android sharing (#545)
parent
62b07f93fd
commit
c8e51a7d48
|
@ -1,4 +1,4 @@
|
||||||
import {isNative} from 'platform/detection'
|
import {isIOS, isAndroid} from 'platform/detection'
|
||||||
// import * as Sharing from 'expo-sharing'
|
// import * as Sharing from 'expo-sharing'
|
||||||
import Clipboard from '@react-native-clipboard/clipboard'
|
import Clipboard from '@react-native-clipboard/clipboard'
|
||||||
import * as Toast from '../view/com/util/Toast'
|
import * as Toast from '../view/com/util/Toast'
|
||||||
|
@ -11,8 +11,10 @@ import {Share} from 'react-native'
|
||||||
* clipboard.
|
* clipboard.
|
||||||
*/
|
*/
|
||||||
export async function shareUrl(url: string) {
|
export async function shareUrl(url: string) {
|
||||||
if (isNative) {
|
if (isAndroid) {
|
||||||
Share.share({url: url})
|
Share.share({message: url})
|
||||||
|
} else if (isIOS) {
|
||||||
|
Share.share({url})
|
||||||
} else {
|
} else {
|
||||||
// React Native Share is not supported by web. Web Share API
|
// React Native Share is not supported by web. Web Share API
|
||||||
// has increasing but not full support, so default to clipboard
|
// has increasing but not full support, so default to clipboard
|
||||||
|
|
Loading…
Reference in New Issue