mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-02-12 16:52:51 +00:00
Ask for location permission first, notifications later. Roadmap.
This commit is contained in:
@@ -97,10 +97,15 @@ Changelog content is stored in `assets/changelog.json`:
|
||||
|
||||
### User Experience Flow
|
||||
- **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
|
||||
- **Version Updates**: Changelog popup (only if content exists, no "don't show again")
|
||||
- **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
|
||||
The welcome popup explains that the app:
|
||||
- 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)
|
||||
- **Configurable distance**: 25-200 meter alert radius
|
||||
- **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:**
|
||||
- Uses Flutter Local Notifications for cross-platform background alerts
|
||||
- Simple RecentAlert tracking prevents duplicate notifications
|
||||
- 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
|
||||
|
||||
|
||||
@@ -104,7 +104,9 @@ cp lib/keys.dart.example lib/keys.dart
|
||||
## Roadmap
|
||||
|
||||
### 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
|
||||
- Tile cache trimming? Does fluttermap handle?
|
||||
- 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
|
||||
|
||||
### 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
|
||||
- Turn by turn navigation or at least swipe nav sheet up to see a list
|
||||
- Import/Export map providers
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
{
|
||||
"2.6.3": {
|
||||
"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",
|
||||
"• 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": {
|
||||
|
||||
@@ -27,6 +27,7 @@ import '../services/changelog_service.dart';
|
||||
import 'coordinators/sheet_coordinator.dart';
|
||||
import 'coordinators/navigation_coordinator.dart';
|
||||
import 'coordinators/map_interaction_handler.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
|
||||
class HomeScreen extends StatefulWidget {
|
||||
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
|
||||
Future<void> _checkForPopup() async {
|
||||
if (!mounted) return;
|
||||
@@ -178,6 +206,10 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
||||
barrierDismissible: false,
|
||||
builder: (context) => const WelcomeDialog(),
|
||||
);
|
||||
|
||||
// Request location permission right after welcome dialog on first launch
|
||||
if (!mounted) return;
|
||||
await _requestLocationPermissionIfFirstLaunch();
|
||||
break;
|
||||
|
||||
case PopupType.changelog:
|
||||
|
||||
@@ -41,9 +41,9 @@ class ProximityAlertService {
|
||||
|
||||
const androidSettings = AndroidInitializationSettings('@mipmap/ic_launcher');
|
||||
const iosSettings = DarwinInitializationSettings(
|
||||
requestAlertPermission: true,
|
||||
requestBadgePermission: true,
|
||||
requestSoundPermission: true,
|
||||
requestAlertPermission: false,
|
||||
requestBadgePermission: false,
|
||||
requestSoundPermission: false,
|
||||
);
|
||||
|
||||
const initSettings = InitializationSettings(
|
||||
@@ -55,12 +55,10 @@ class ProximityAlertService {
|
||||
final initialized = await _notifications!.initialize(initSettings);
|
||||
_isInitialized = initialized ?? false;
|
||||
|
||||
// Request notification permissions (especially important for Android 13+)
|
||||
if (_isInitialized) {
|
||||
await _requestNotificationPermissions();
|
||||
}
|
||||
// Note: We don't request notification permissions here anymore.
|
||||
// Permissions are requested on-demand when user enables proximity alerts.
|
||||
|
||||
debugPrint('[ProximityAlertService] Initialized: $_isInitialized');
|
||||
debugPrint('[ProximityAlertService] Initialized: $_isInitialized (permissions deferred)');
|
||||
} catch (e) {
|
||||
debugPrint('[ProximityAlertService] Failed to initialize: $e');
|
||||
_isInitialized = false;
|
||||
|
||||
Reference in New Issue
Block a user