Share.share(content, options) receives content and options parameter separately.
Share.share(content, options) returns a Promise on both Android and IOS. You basically need to resolve the Promise or read the response from it.
Like so
Share.share(
{
message: 'Your message',
url: YourURL
}
).then(({action, activityType}) => {
if(action === Share.sharedAction)
console.log('Share was successful');
else
console.log('Share was dismissed');
});
Promise returns an object containing action, activityType
If the user dismissed the dialog, the Promise will be resolved with action being Share.dismissedAction else with action being Share.sharedAction
You have to handle promise for this ..
onSharePress = (url) => {
Share.share({
title: 'Alert Title',
message: url + '\nMessage goes here.'
}).then((res) => console.log(res))
.catch((error) => console.log(error))
};
Read the friendly share()
docs:
Content
message
- a message to share
title
- title of the messageiOS
url
- an URL to shareAt least one of URL and message is required.
So on Android, the url
option does nothing, and you probably need to put it into message
.
like share text on WhatsApp
Linking.openURL(
whatsapp://send?text=${'hello whatsApp'}
);
like share text on Google
Linking.openURL('https://support.google.com/mail/community');
open your Contact in React Native App
Linking.openURL('content://com.android.contacts/contacts');
<div id="parent"> <div id="child1"> <div id="child2"> <div id="child3"> <div id="child4"> </div> </...
<div id="parent"> <div id="child1"> <div id="child2"> <div id="child3"> <div id="child4"> </div> </...
As an example, let's say I've a component that can take in props like this: const testComponent = (props: {isBold: boolean}) => { if(props.isBold) return <strong><div>hello</...
As an example, let's say I've a component that can take in props like this: const testComponent = (props: {isBold: boolean}) => { if(props.isBold) return <strong><div>hello</...
What I'm trying to achieve here is intellisense/autocomplete for an object that's been generated from an array - something like an Action Creator for Redux, an array of strings (string[]) that can be ...
What I'm trying to achieve here is intellisense/autocomplete for an object that's been generated from an array - something like an Action Creator for Redux, an array of strings (string[]) that can be ...
I've been trying to get this to work from other posts, but keep running into a wall. I have an "All" button, that I'd like select all or unselect all in the closest div class of "apply_all" I'm ...
I've been trying to get this to work from other posts, but keep running into a wall. I have an "All" button, that I'd like select all or unselect all in the closest div class of "apply_all" I'm ...