mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix file share not appearing in share menu on iOS
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import React, {createRef} from 'react';
|
import React, {createRef} from 'react';
|
||||||
|
import { Platform } from 'react-native';
|
||||||
import {Clipboard, View} from 'react-native';
|
import {Clipboard, View} from 'react-native';
|
||||||
import QRCode from 'react-native-qrcode-svg';
|
import QRCode from 'react-native-qrcode-svg';
|
||||||
import Share from 'react-native-share';
|
import Share from 'react-native-share';
|
||||||
@@ -137,7 +138,7 @@ class RecoveryKeyDialog extends React.Component {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let path = await Storage.checkAndCreateDir('/');
|
let path = await Storage.checkAndCreateDir('/');
|
||||||
let fileName = 'nn_' + 'test' + '_recovery_key.txt';
|
let fileName = 'nn_' + this.user?.email + '_recovery_key.txt';
|
||||||
RNFetchBlob = require('rn-fetch-blob').default;
|
RNFetchBlob = require('rn-fetch-blob').default;
|
||||||
await RNFetchBlob.fs.writeFile(path + fileName, this.state.key, 'utf8');
|
await RNFetchBlob.fs.writeFile(path + fileName, this.state.key, 'utf8');
|
||||||
ToastEvent.show({
|
ToastEvent.show({
|
||||||
@@ -167,9 +168,8 @@ class RecoveryKeyDialog extends React.Component {
|
|||||||
if (!path) return;
|
if (!path) return;
|
||||||
try {
|
try {
|
||||||
await Share.open({
|
await Share.open({
|
||||||
url: 'file:/' + path,
|
url: Platform.OS === "ios" ? path : 'file:/' + path,
|
||||||
title: 'Save recovery key to cloud',
|
title: 'Save recovery key to cloud',
|
||||||
message: this.state.key,
|
|
||||||
failOnCancel: false,
|
failOnCancel: false,
|
||||||
});
|
});
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user