evan 4 anni fa
parent
commit
1cced54942
2 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 5 1
      ios/Runner/Info.plist
  2. 1 0
      lib/my_tools/loacion_util.dart

+ 5 - 1
ios/Runner/Info.plist

@@ -103,7 +103,11 @@
 	<key>NSPhotoLibraryUsageDescription</key>
 	<string>我们需要访问您的相册,用于上传附件照片</string>
 	<key>NSSpeechRecognitionUsageDescription</key>
-	<string>pp需要您的同意,才能访问语音</string>
+	<string>App需要您的同意,才能访问语音</string>
+	<key>UIBackgroundModes</key>
+	<array>
+		<string>location</string>
+	</array>
 	<key>UILaunchStoryboardName</key>
 	<string>LaunchScreen</string>
 	<key>UIMainStoryboardFile</key>

+ 1 - 0
lib/my_tools/loacion_util.dart

@@ -41,6 +41,7 @@ class LocationUtil {
     var locationStatus = await Permission.location.status;
     var cameraStatus = await Permission.camera.status;
     if (locationStatus.isDenied) {
+      print("locationStatus.isDenied");
       await Permission.location.request().then((value) async {
         if (value == PermissionStatus.granted) {
           _setLocationOption();