瀏覽代碼

allow location streaming from background

cyberta 5 年之前
父節點
當前提交
0b56fc59d6
共有 2 個文件被更改,包括 4 次插入3 次删除
  1. 1 1
      deltachat-ios/Helper/LocationManager.swift
  2. 3 2
      deltachat-ios/Info.plist

+ 1 - 1
deltachat-ios/Helper/LocationManager.swift

@@ -12,8 +12,8 @@ class LocationManager: NSObject, CLLocationManagerDelegate {
         locationManager = CLLocationManager()
         locationManager = CLLocationManager()
         locationManager.distanceFilter = 50
         locationManager.distanceFilter = 50
         locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters
         locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters
-        //locationManager.allowsBackgroundLocationUpdates = true
         locationManager.pausesLocationUpdatesAutomatically = true
         locationManager.pausesLocationUpdatesAutomatically = true
+        locationManager.allowsBackgroundLocationUpdates = true
         //TODO: check which activity Type is needed
         //TODO: check which activity Type is needed
         locationManager.activityType = CLActivityType.other
         locationManager.activityType = CLActivityType.other
         super.init()
         super.init()

+ 3 - 2
deltachat-ios/Info.plist

@@ -40,12 +40,12 @@
 	<true/>
 	<true/>
 	<key>NSCameraUsageDescription</key>
 	<key>NSCameraUsageDescription</key>
 	<string>Delta Chat uses your camera to take and send photos and videos and to scan QR codes.</string>
 	<string>Delta Chat uses your camera to take and send photos and videos and to scan QR codes.</string>
+	<key>NSContactsUsageDescription</key>
+	<string>Delta Chat uses your contacts to show a list of email addresses you can write to. Delta Chat has no server, your contacts are not sent anywhere.</string>
 	<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
 	<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
 	<string>Delta Chat needs the location permission in order to share your location for the timespan you have enabled location sharing.</string>
 	<string>Delta Chat needs the location permission in order to share your location for the timespan you have enabled location sharing.</string>
 	<key>NSLocationWhenInUseUsageDescription</key>
 	<key>NSLocationWhenInUseUsageDescription</key>
 	<string>Delta Chat needs the location permission in order to share your location for the timespan you have enabled location sharing.</string>
 	<string>Delta Chat needs the location permission in order to share your location for the timespan you have enabled location sharing.</string>
-	<key>NSContactsUsageDescription</key>
-	<string>Delta Chat uses your contacts to show a list of email addresses you can write to. Delta Chat has no server, your contacts are not sent anywhere.</string>
 	<key>NSMicrophoneUsageDescription</key>
 	<key>NSMicrophoneUsageDescription</key>
 	<string>Delta Chat uses your microphone to record and send voice messages and videos with sound.</string>
 	<string>Delta Chat uses your microphone to record and send voice messages and videos with sound.</string>
 	<key>NSPhotoLibraryUsageDescription</key>
 	<key>NSPhotoLibraryUsageDescription</key>
@@ -53,6 +53,7 @@
 	<key>UIBackgroundModes</key>
 	<key>UIBackgroundModes</key>
 	<array>
 	<array>
 		<string>fetch</string>
 		<string>fetch</string>
+		<string>location</string>
 	</array>
 	</array>
 	<key>UIFileSharingEnabled</key>
 	<key>UIFileSharingEnabled</key>
 	<true/>
 	<true/>