Skip to content

Commit 3a7dff0

Browse files
Tushar SharmaTushar Sharma
authored andcommitted
chore(ios): Remove location dialog for iOS.
1 parent 012dd19 commit 3a7dff0

3 files changed

Lines changed: 21 additions & 13 deletions

File tree

example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This is a generated file; do not edit or check into version control.
2-
FLUTTER_ROOT=/Users/tusharsharma/Downloads/flutter
3-
FLUTTER_APPLICATION_PATH=/Users/tusharsharma/StudioProjects/fa_flutter_ui_kit/example
2+
FLUTTER_ROOT=/Users/tusharf2k/Downloads/flutter
3+
FLUTTER_APPLICATION_PATH=/Users/tusharf2k/StudioProjects/fa_flutter_ui_kit/example
44
COCOAPODS_PARALLEL_CODE_SIGN=true
55
FLUTTER_BUILD_DIR=build
66
FLUTTER_BUILD_NAME=1.0.0

example/macos/Flutter/ephemeral/flutter_export_environment.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
# This is a generated file; do not edit or check into version control.
3-
export "FLUTTER_ROOT=/Users/tusharsharma/Downloads/flutter"
4-
export "FLUTTER_APPLICATION_PATH=/Users/tusharsharma/StudioProjects/fa_flutter_ui_kit/example"
3+
export "FLUTTER_ROOT=/Users/tusharf2k/Downloads/flutter"
4+
export "FLUTTER_APPLICATION_PATH=/Users/tusharf2k/StudioProjects/fa_flutter_ui_kit/example"
55
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
66
export "FLUTTER_BUILD_DIR=build"
77
export "FLUTTER_BUILD_NAME=1.0.0"

lib/src/core/location_info/location_info.dart

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'dart:async';
2+
import 'dart:io';
23

34
import 'package:fa_flutter_core/fa_flutter_core.dart';
45
import 'package:fa_flutter_ui_kit/fa_flutter_ui_kit.dart';
@@ -67,15 +68,22 @@ class LocationInfoImpl implements LocationInfo {
6768
@override
6869
Future initLocation() async {
6970
if (isMobile) {
70-
final permissionStatus = await isLocationPermissionGranted();
71-
72-
if (!permissionStatus) {
73-
if (navKey != null) {
74-
await DialogUtils.showAlertDialog(
75-
title: 'Location Permission Required!',
76-
content: defaultLocationReason,
77-
actionText: 'Continue',
78-
navKey: navKey!);
71+
/// For iOS, location will be asked at day start time so not showing this
72+
/// on Splash page.
73+
/// This is done because iOS app gets rejected if we ask for location
74+
/// on splash and if it is disabled, user is asked to turn on the location
75+
/// to use the app
76+
if(!Platform.isIOS){
77+
final permissionStatus = await isLocationPermissionGranted();
78+
79+
if (!permissionStatus) {
80+
if (navKey != null) {
81+
await DialogUtils.showAlertDialog(
82+
title: 'Location Permission Required!',
83+
content: defaultLocationReason,
84+
actionText: 'Continue',
85+
navKey: navKey!);
86+
}
7987
}
8088
}
8189

0 commit comments

Comments
 (0)