Commit bf719d6c authored by Martin Santangelo's avatar Martin Santangelo

(fix) share dialog not shown on ios

parent 15315a65
import { Share } from 'react-native';
import Share from 'react-native-share';
/**
* Share service
......@@ -10,7 +10,6 @@ class ShareService {
* @param {string} referrer guid
*/
invite(guid) {
const url = 'https://www.minds.com/register?referrer=' + guid;
const title = 'Join me on Minds.com';
......@@ -23,18 +22,18 @@ class ShareService {
* @param {string} url
*/
share(title, url) {
msg = {
title: title,
message: url,
};
opt = {
subject: title,
dialogTitle: title
}
Share.share(msg, opt);
// added a settimeout as a workaround for ios, without it the share dialog is not shown
setTimeout(async () => {
try {
await Share.open({
title: title,
message: url,
});
} catch (err) {
console.log(err);
}
}, 600);
}
}
export default new ShareService();
\ No newline at end of file
export default new ShareService();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment