1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-24 08:12:24 +02:00

Android: Fixes #8533: Trying to fix sharing issues

This commit is contained in:
Laurent Cozic 2023-07-25 16:45:21 +01:00
parent 0c4513838a
commit 5357b2b0dc
2 changed files with 7 additions and 1 deletions

View File

@ -8,6 +8,8 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.POST_NOTIFICATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<!-- Make these features optional to enable Chromebooks -->
<!-- https://github.com/laurent22/joplin/issues/37 -->

View File

@ -15,7 +15,11 @@ export default async (sharedData: SharedData, folderId: string, dispatch: Functi
if (Platform.OS === 'android') {
const response = await checkPermissions(PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE);
if (response !== PermissionsAndroid.RESULTS.GRANTED) {
// Note that if the permission is NEVER_ASK_AGAIN, it might still
// work because of the way Android permissions work after Android
// 10. So it means in that case we give it a try anyway.
// https://stackoverflow.com/a/73630987/561309
if (response === PermissionsAndroid.RESULTS.DENIED) {
ToastAndroid.show('Cannot receive shared data - permission denied', ToastAndroid.SHORT);
ShareExtension.close();
return;