1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

Android: Improve location permission request (#13248)

This commit is contained in:
Henry Heino
2025-09-20 02:00:15 -07:00
committed by GitHub
parent 47c82a7e75
commit a6e671d45b
3 changed files with 33 additions and 13 deletions

View File

@@ -543,8 +543,17 @@ class NoteScreenComponent extends BaseScreenComponent<ComponentProps, State> imp
if (Platform.OS === 'web') return;
const response = await checkPermissions(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, {
message: _('In order to associate a geo-location with the note, the app needs your permission to access your location.\n\nYou may turn off this option at any time in the Configuration screen.'),
title: _('Permission needed'),
onRequestConfirmation: async () => {
const yesIndex = 0;
const result = await shim.showMessageBox(
_('Joplin supports saving the location at which notes are saved or created. Do you want to enable it? This can be changed at any time in settings.'),
{
buttons: [_('Yes'), _('No')],
title: _('Save geolocation?'),
},
);
return result === yesIndex;
},
});
// If the user simply pressed "Deny", we don't automatically switch it off because they might accept