Skip to content

Commit

Permalink
fix: Correctly handle Share url on Android
Browse files Browse the repository at this point in the history
As described in the `Share` documentation, the `url` parameter is
handled only on iOS

On Android we want to concatenate the `url` parameter to the `message`
one so the generated sharing text contains it

More info: https://reactnative.dev/docs/share#share
  • Loading branch information
Ldoppea committed Sep 20, 2022
1 parent 8b228c6 commit 4adca05
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Share } from 'react-native'
import { Platform, Share } from 'react-native'
import { WebViewMessageEvent } from 'react-native-webview/lib/WebViewTypes'
import { OnAnswerCallback, SubscriberPayload } from './types'

Expand Down Expand Up @@ -87,7 +87,7 @@ export const tryNavigatorShare = async (
try {
const result = await Share.share({
title,
message,
message: Platform.OS === 'android' ? `${message} ${url}` : message,
url
})

Expand Down

0 comments on commit 4adca05

Please sign in to comment.