Ask for location permission first, notifications later. Roadmap.

This commit is contained in:
stopflock committed 2026-02-03 16:22:46 -06:00
1 parent aba919f8d4
commit 38245bfb5b
5 files changed
+53 -10

No files matched your search

+7
View File
@@ -97,10 +97,15 @@ Changelog content is stored in `assets/changelog.json`:
### User Experience Flow ### User Experience Flow
- **First Launch**: Welcome popup with "don't show again" option - **First Launch**: Welcome popup with "don't show again" option
- **Location Permission**: Requested immediately after welcome dialog on first launch (v2.6.3+)
- **First Submission**: Submission guide popup with best practices and resource links - **First Submission**: Submission guide popup with best practices and resource links
- **Version Updates**: Changelog popup (only if content exists, no "don't show again") - **Version Updates**: Changelog popup (only if content exists, no "don't show again")
- **Settings Access**: Complete changelog history available in Settings > About > Release Notes - **Settings Access**: Complete changelog history available in Settings > About > Release Notes
### Permission Handling (Updated v2.6.3)
- **Location Permission**: Requested on first launch for core GPS functionality
- **Notification Permission**: Requested on-demand when user enables proximity alerts
### Privacy Integration ### Privacy Integration
The welcome popup explains that the app: The welcome popup explains that the app:
- Runs entirely locally on device - Runs entirely locally on device
@@ -365,11 +370,13 @@ Local cache contains production data. Showing production nodes in sandbox mode w
- **Dual alert types**: Push notifications (background) and visual banners (foreground) - **Dual alert types**: Push notifications (background) and visual banners (foreground)
- **Configurable distance**: 25-200 meter alert radius - **Configurable distance**: 25-200 meter alert radius
- **Battery awareness**: Users explicitly opt into background location monitoring - **Battery awareness**: Users explicitly opt into background location monitoring
- **On-demand permissions**: Notification permission requested only when user enables proximity alerts (v2.6.3+)
**Implementation notes:** **Implementation notes:**
- Uses Flutter Local Notifications for cross-platform background alerts - Uses Flutter Local Notifications for cross-platform background alerts
- Simple RecentAlert tracking prevents duplicate notifications - Simple RecentAlert tracking prevents duplicate notifications
- Visual callback system for in-app alerts when app is active - Visual callback system for in-app alerts when app is active
- Permission requests deferred until feature activation for better UX
### 9. Compass Indicator & North Lock ### 9. Compass Indicator & North Lock
+5 -1
View File
@@ -104,7 +104,9 @@ cp lib/keys.dart.example lib/keys.dart
## Roadmap ## Roadmap
### Needed Bugfixes ### Needed Bugfixes
- Ask for location permission on first launch, temp disable notification permission - Imperial units
- Pass through tags on existing nodes which are not included in selected profile to the refine tags page, much like we do for all tags when "existing tags" profile is selected
- Move "pause queue" toggle
- Make submission guide scarier - Make submission guide scarier
- Tile cache trimming? Does fluttermap handle? - Tile cache trimming? Does fluttermap handle?
- Filter NSI suggestions based on what has already been typed in - Filter NSI suggestions based on what has already been typed in
@@ -112,6 +114,8 @@ cp lib/keys.dart.example lib/keys.dart
- Clean cache when nodes have been deleted by others - Clean cache when nodes have been deleted by others
### Current Development ### Current Development
- Support check_date= tag, update on all edits, quick button to update that only
- Support source= tag, default to survey, let user pick a different value
- Add ability to downvote suspected locations which are old enough - Add ability to downvote suspected locations which are old enough
- Turn by turn navigation or at least swipe nav sheet up to see a list - Turn by turn navigation or at least swipe nav sheet up to see a list
- Import/Export map providers - Import/Export map providers
+3 -1
View File
@@ -1,8 +1,10 @@
{ {
"2.6.3": { "2.6.3": {
"content": [ "content": [
"• Improved first launch experience - location permission is now requested immediately after welcome dialog",
"• Notification permission is now requested only when user enables proximity alerts (better UX)",
"• Prevent edit submissions where nothing (location, tags, direction) has been changed", "• Prevent edit submissions where nothing (location, tags, direction) has been changed",
"• FIXED: Node data not loading in sandbox mode - improved cache integration and status reporting for development testing" "• Allow customizing changeset comment on refine tags page"
] ]
}, },
"2.6.2": { "2.6.2": {
+32
View File
@@ -27,6 +27,7 @@ import '../services/changelog_service.dart';
import 'coordinators/sheet_coordinator.dart'; import 'coordinators/sheet_coordinator.dart';
import 'coordinators/navigation_coordinator.dart'; import 'coordinators/navigation_coordinator.dart';
import 'coordinators/map_interaction_handler.dart'; import 'coordinators/map_interaction_handler.dart';
import 'package:geolocator/geolocator.dart';
class HomeScreen extends StatefulWidget { class HomeScreen extends StatefulWidget {
const HomeScreen({super.key}); const HomeScreen({super.key});
@@ -153,6 +154,33 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
); );
} }
// Request location permission on first launch
Future<void> _requestLocationPermissionIfFirstLaunch() async {
if (!mounted) return;
try {
// Only request on first launch or if user has never seen welcome
final isFirstLaunch = await ChangelogService().isFirstLaunch();
final hasSeenWelcome = await ChangelogService().hasSeenWelcome();
if (isFirstLaunch || !hasSeenWelcome) {
// Check if location services are enabled
bool serviceEnabled = await Geolocator.isLocationServiceEnabled();
if (!serviceEnabled) {
debugPrint('[HomeScreen] Location services disabled - skipping permission request');
return;
}
// Request location permission (this will show system dialog if needed)
final permission = await Geolocator.requestPermission();
debugPrint('[HomeScreen] First launch location permission result: $permission');
}
} catch (e) {
// Silently handle errors to avoid breaking the app launch
debugPrint('[HomeScreen] Error requesting location permission: $e');
}
}
// Check for and display welcome/changelog popup // Check for and display welcome/changelog popup
Future<void> _checkForPopup() async { Future<void> _checkForPopup() async {
if (!mounted) return; if (!mounted) return;
@@ -178,6 +206,10 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
barrierDismissible: false, barrierDismissible: false,
builder: (context) => const WelcomeDialog(), builder: (context) => const WelcomeDialog(),
); );
// Request location permission right after welcome dialog on first launch
if (!mounted) return;
await _requestLocationPermissionIfFirstLaunch();
break; break;
case PopupType.changelog: case PopupType.changelog:
+6 -8
View File
@@ -41,9 +41,9 @@ class ProximityAlertService {
const androidSettings = AndroidInitializationSettings('@mipmap/ic_launcher'); const androidSettings = AndroidInitializationSettings('@mipmap/ic_launcher');
const iosSettings = DarwinInitializationSettings( const iosSettings = DarwinInitializationSettings(
requestAlertPermission: true, requestAlertPermission: false,
requestBadgePermission: true, requestBadgePermission: false,
requestSoundPermission: true, requestSoundPermission: false,
); );
const initSettings = InitializationSettings( const initSettings = InitializationSettings(
@@ -55,12 +55,10 @@ class ProximityAlertService {
final initialized = await _notifications!.initialize(initSettings); final initialized = await _notifications!.initialize(initSettings);
_isInitialized = initialized ?? false; _isInitialized = initialized ?? false;
// Request notification permissions (especially important for Android 13+) // Note: We don't request notification permissions here anymore.
if (_isInitialized) { // Permissions are requested on-demand when user enables proximity alerts.
await _requestNotificationPermissions();
}
debugPrint('[ProximityAlertService] Initialized: $_isInitialized'); debugPrint('[ProximityAlertService] Initialized: $_isInitialized (permissions deferred)');
} catch (e) { } catch (e) {
debugPrint('[ProximityAlertService] Failed to initialize: $e'); debugPrint('[ProximityAlertService] Failed to initialize: $e');
_isInitialized = false; _isInitialized = false;