You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,13 @@
1
+
## [1.1.0]
2
+
3
+
-**Breaking change :**`Geolocation.requestLocationPermission` now takes a named parameter for permission
4
+
-**Breaking change :** New `GeolocationResultErrorType.permissionNotGranted` type. Previous meaning for `permissionDenied` is now divided in two different states:
5
+
-`permissionNotGranted`: User didn't accept nor decline the locationn permission request yet
6
+
-`permissionDenied`: User specifically declined the permission request
7
+
- Ability to open settings when requesting permission, and user already declined the permission previously: `Geolocation.requestLocationPermission(openSettingsIfDenied: true)` (opening the settings as fallback is now the default behaviour).
You can also check the example project that showcase a comprehensive usage of Geolocation plugin.
105
89
106
90
### Check if location service is operational
107
91
108
-
API documentation: https://pub.dartlang.org/documentation/geolocation/0.2.1/geolocation/Geolocation/isLocationOperational.html
92
+
API documentation: https://pub.dartlang.org/documentation/geolocation/latest/geolocation/Geolocation/isLocationOperational.html
109
93
110
94
```dart
111
95
final GeolocationResult result = await Geolocation.isLocationOperational();
@@ -118,24 +102,27 @@ if(result.isSuccessful) {
118
102
119
103
### Request location permission
120
104
121
-
On Android (api 23+) and iOS, geolocation needs to request permission at runtime.
105
+
On Android (api 23+) and iOS, apps need to request location permission at runtime.
122
106
123
107
_Note: You are not required to request permission manually.
124
108
Geolocation plugin will request permission automatically if it's needed, when you make a location request._
125
109
126
-
API documentation: https://pub.dartlang.org/documentation/geolocation/0.2.1/geolocation/Geolocation/requestLocationPermission.html
110
+
API documentation: https://pub.dartlang.org/documentation/geolocation/latest/geolocation/Geolocation/requestLocationPermission.html
127
111
128
112
```dart
129
-
final GeolocationResult result = await Geolocation.requestLocationPermission(const LocationPermission(
130
-
android: LocationPermissionAndroid.fine,
131
-
ios: LocationPermissionIOS.always,
132
-
));
113
+
final GeolocationResult result = await Geolocation.requestLocationPermission(
114
+
const LocationPermission(
115
+
android: LocationPermissionAndroid.fine,
116
+
ios: LocationPermissionIOS.always,
117
+
),
118
+
openSettingsIfDenied: true,
119
+
);
133
120
134
121
if(result.isSuccessful) {
135
122
// location permission is granted (or was already granted before making the request)
136
123
} else {
137
124
// location permission is not granted
138
-
// user might have denied, but it's also possible that location service is not enabled, restricted, and user never saw the permission request dialog
125
+
// user might have denied, but it's also possible that location service is not enabled, restricted, and user never saw the permission request dialog. Check the result.error.type for details.
0 commit comments