-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
44 lines (40 loc) · 1.03 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import {View, Text, Button} from 'react-native';
import React from 'react';
import Share from 'react-native-share';
export default function App() {
const share = async () => {
const options = {
message:
'Deserunt ea sint magna dolor incididunt sit culpa id laborum cupidatat commodo do sint.',
url: 'https://sgcodes.co.in',
email: 'codes.sg@gmail.com',
subject: 'Eiusmod esse veniam esse.',
recipient: '919988998899',
};
try {
const res = await Share.open(options);
console.log(res);
} catch (err) {
console.log(err);
}
// Share.open(options)
// .then(res => console.log(res))
// .catch(err => console.log(err));
};
return (
<View>
<Text
style={{
fontSize: 40,
marginVertical: 40,
color: 'black',
textAlign: 'center',
}}>
React Native Share
</Text>
<View style={{marginHorizontal: 40}}>
<Button title="Share" onPress={share} />
</View>
</View>
);
}