2020-06-04 19:40:44 +02:00
|
|
|
const { NativeModules, Platform } = require('react-native');
|
|
|
|
|
|
|
|
export interface SharedData {
|
2020-11-12 21:29:22 +02:00
|
|
|
title?: string;
|
|
|
|
text?: string;
|
|
|
|
resources?: string[];
|
2020-06-04 19:40:44 +02:00
|
|
|
}
|
|
|
|
|
2021-04-24 10:22:11 +02:00
|
|
|
const ShareExtension = (NativeModules.ShareExtension) ?
|
2020-06-04 19:40:44 +02:00
|
|
|
{
|
|
|
|
data: () => NativeModules.ShareExtension.data(),
|
|
|
|
close: () => NativeModules.ShareExtension.close(),
|
2021-04-24 10:22:11 +02:00
|
|
|
shareURL: (Platform.OS === 'ios') ? NativeModules.ShareExtension.getConstants().SHARE_EXTENSION_SHARE_URL : '',
|
2020-06-04 19:40:44 +02:00
|
|
|
} :
|
|
|
|
{
|
|
|
|
data: () => {},
|
|
|
|
close: () => {},
|
2021-04-24 10:22:11 +02:00
|
|
|
shareURL: '',
|
2020-06-04 19:40:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ShareExtension;
|