Skip to content

CoreLocation tvOS xcode14.0 rc

tj_devel709 edited this page Sep 16, 2022 · 3 revisions

#CoreLocation.framework https://github.com/xamarin/xamarin-macios/pull/15985

diff -ruN /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CLError.h /Applications/Xcode_14.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CLError.h
--- /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CLError.h	2022-08-06 02:27:42.000000000 -0500
+++ /Applications/Xcode_14.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CLError.h	2022-08-20 00:18:44.000000000 -0500
@@ -37,6 +37,7 @@
 	kCLErrorRangingUnavailable,           // Ranging cannot be performed
 	kCLErrorRangingFailure,               // General ranging failure
 	kCLErrorPromptDeclined,               // Authorization request not presented to user
+	kCLErrorHistoricalLocationError,      // Historical Locations set up error
 };
 
 /*
diff -ruN /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h /Applications/Xcode_14.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h
--- /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h	2022-08-05 15:54:22.000000000 -0500
+++ /Applications/Xcode_14.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h	2022-08-23 01:16:08.000000000 -0500
@@ -816,6 +816,47 @@
  */
 + (BOOL)deferredLocationUpdatesAvailable API_DEPRECATED("You can remove calls to this method", ios(6.0, 13.0), macos(10.9, 10.15)) API_UNAVAILABLE(watchos, tvos);
 
+/*
+ *  requestHistoricalLocationsWithPurposeKey:sampleCount:completionHandler:
+ *
+ *  Discussion:
+ *      Request asynchronous delivery of historical location information.
+ *
+ *      If the app is currently configured correctly, historical locations are
+ *      available, and this request is approved by the user via prompt,
+ *      then the historical locations will be delivered to the completion handler.
+ *      Otherwise, the completion handler will be invoked with an empty array.
+ *
+ *      Historical location availability is subject to privacy limits and should never
+ *      be assumed available.  If historic location is not available, no prompt will be
+ *      presented to the user, and the empty array will be returned.
+ *
+ *      The sampleCount parameter may be used to limit the number of returned
+ *      locations by decimation.
+ *
+ *      Correct configuration requires the App to:
+ *      - Have effective authorization to receive the user's current location.
+ *      - Carry the required entitlement:
+ *             com.apple.developer.corelocation.wilderness-safety
+ *      - Have a NSLocationWildernessSafetyUsageDescriptionDictionary in its
+ *        info.plist and related localized resources
+ *      - Pass a key identifying a usage description string in that dictionary to be
+ *        included in the prompt to the user if one is shown.
+ *
+ *      The completion handler will receive a non-nil error object in the event of misconfiguration.
+ *
+ *      Requires the com.apple.developer.corelocation.wilderness-safety entitlement.
+ *
+ */
+- (void)requestHistoricalLocationsWithPurposeKey:(NSString *)purposeKey
+									 sampleCount:(NSInteger)sampleCount
+                               completionHandler:(void(^)(NSArray<CLLocation *> *, NSError *_Nullable))handler
+	API_AVAILABLE(watchos(9.0)) API_UNAVAILABLE(ios) API_UNAVAILABLE(macos, tvos)
+	NS_SWIFT_NAME(requestHistoricalLocations(purposeKey:sampleCount:completionHandler:))
+#ifdef NS_SWIFT_ASYNC_NAME
+	NS_SWIFT_ASYNC_NAME(historicalLocations(purposeKey:sampleCount:))
+#endif
+	;
 
 @end
 
Clone this wiki locally