The problem is In Android, you cant specify something as url , but the same when you do in IOS, youll get the link (Check the docs to cross verify :rn-share. Its better you can send the link of the app in the message itself so that both platforms can get it without writing double code.
Like this is the example :
import React from 'react';
import { Share, View, Button } from 'react-native';
export default ShareExample = () => {
const onShare = async () => {
try {
const result = await Share.share({
title: 'App link',
message: 'Please install this app and stay safe , AppLink :https://play.google.com/store/apps/details?id=nic.goi.aarogyasetu&hl=en',
url: 'https://play.google.com/store/apps/details?id=nic.goi.aarogyasetu&hl=en'
});
if (result.action === Share.sharedAction) {
if (result.activityType) {
// shared with activity type of result.activityType
} else {
// shared
}
} else if (result.action === Share.dismissedAction) {
// dismissed
}
} catch (error) {
alert(error.message);
}
};
return (
<View style={{ marginTop: 50 }}>
<Button onPress={onShare} title="Share" />
</View>
);
};
Hope it helps. feel free for doubts