-
Notifications
You must be signed in to change notification settings - Fork 547
Photos iOS xcode26.1 b2
Rolf Bjarne Kvinge edited this page Oct 7, 2025
·
1 revision
#Photos.framework
diff -ruN /Applications/Xcode_26.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJob.h /Applications/Xcode_26.1.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJob.h
--- /Applications/Xcode_26.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJob.h 1970-01-01 01:00:00
+++ /Applications/Xcode_26.1.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJob.h 2025-09-30 08:57:29
@@ -0,0 +1,44 @@
+
+//
+// PHAssetResourceUploadJob.h
+// PhotoKit
+//
+// Copyright © 2025 Apple Inc. All rights reserved.
+//
+
+#import <Photos/PHObject.h>
+#import <Photos/PhotosTypes.h>
+
+@class PHAssetResource;
+@class PHFetchOptions;
+@class PHFetchResult<T>;
+
+NS_ASSUME_NONNULL_BEGIN
+
+/// Represents a request to upload a `PHAssetResource`
+///
+/// Used within an application's `com.apple.photos.background-upload` extension to represent a request to upload a `PHAssetResource` to a destination `NSURLRequest`.
+///
+/// When the extensions principal class receives a call to `process` background uploads, it can create new `PHAssetResourceUploadJob`s using `PHAssetResourceUploadJobChangeRequest` and any existing upload jobs can be fetched using `fetchJobsWithAction:options:` and handled by updating their state using a `PHAssetResourceUploadJobChangeRequest` to mark them as acknowledged, or to be retried. The maximum number of jobs that can be a in flight is limited to the `jobLimit`.
+NS_SWIFT_SENDABLE
+API_AVAILABLE(ios(26.1)) API_UNAVAILABLE(macos, macCatalyst, tvos, visionos, watchos)
+@interface PHAssetResourceUploadJob : PHObject
+
+@property (class, readonly) NSInteger jobLimit; /// The maximum number of unacknowledged upload jobs allowed, this includes registered, pending, succeeded and failed jobs.
+
+@property (strong, readonly) PHAssetResource *resource; /// The asset resource this upload job represents.
+@property (strong, readonly) NSURLRequest *destination; /// The destination to send this asset resource.
+@property (readonly) PHAssetResourceUploadJobState state; /// The state of this upload job.
+
+/// Returns all asset resource upload jobs applicable for a given action.
+///
+/// - Parameters:
+/// - action: The actions a client can take on a job.
+/// - options: The fetch options to be passed in.
+///
+/// - Returns: The jobs available to apply `action` on them.
++ (PHFetchResult<PHAssetResourceUploadJob *> *)fetchJobsWithAction:(PHAssetResourceUploadJobAction)action options:(nullable PHFetchOptions *)options NS_SWIFT_NAME(fetchJobs(action:options:));
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_26.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobChangeRequest.h /Applications/Xcode_26.1.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobChangeRequest.h
--- /Applications/Xcode_26.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobChangeRequest.h 1970-01-01 01:00:00
+++ /Applications/Xcode_26.1.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobChangeRequest.h 2025-09-30 08:57:29
@@ -0,0 +1,45 @@
+//
+// PHAssetResourceUploadJobChangeRequest.h
+// PhotoKit
+//
+// Copyright © 2025 Apple Inc. All rights reserved.
+//
+#import <Photos/PHChangeRequest.h>
+
+@class PHAssetResource;
+@class PHAssetResourceUploadJob;
+
+NS_ASSUME_NONNULL_BEGIN
+
+/// Used within an application's `com.apple.photos.background-upload` extension to create and manage `PHAssetResourceUploadJob` records
+///
+/// When the extensions principal class receives a call to `process` background uploads, it can create new `PHAssetResourceUploadJob`s through calls to perform changes on a PHPhotoLibrary using `PHAssetResourceUploadJobChangeRequest` and any in-flight upload jobs can be handled by updating their state to mark them as acknowledged, or to be retried. The maximum number of jobs that can be in flight is limited to the `PHAssetResourceUploadJob.jobLimit`.
+///
+/// `PHAssetResourceUploadJobChangeRequest` can only be created or used within a photo library change block. For details on change blocks, see `PHPhotoLibrary`.
+API_AVAILABLE(ios(26.1)) API_UNAVAILABLE(macos, macCatalyst, tvos, visionos, watchos)
+@interface PHAssetResourceUploadJobChangeRequest : PHChangeRequest
+
+/// Used to create an asset resource upload job.
+///
+/// If the number of jobs exceeds `jobLimit`the photo library `performChanges` request will fail with a `PHPhotosErrorLimitExceeded` error.
+/// If you want to generate jobs after this limit is triggered, you must acknowledge succeeded and failed jobs, and wait for the registered/pending ones to be uploaded.
+///
+/// - Parameter:
+/// - destination: the destination `NSURLRequest` to which this asset resource will be sent.
+/// - resource: the asset resource to be uploaded.
++ (void)createJobWithDestination:(NSURLRequest *)destination resource:(PHAssetResource *)resource NS_SWIFT_NAME(createJob(destination:resource:));
+
+/// Creates a request for modifying the specified upload job.
+///
+/// - Parameter job: a job to be modified.
++ (nullable instancetype)changeRequestForUploadJob:(nonnull PHAssetResourceUploadJob *)job;
+
+/// Acknowledges a successful or failed job. Jobs must be acknowledged to free up space for `jobLimit`.
+- (void)acknowledge;
+
+/// Retries a job that is failed, unacknowledged, and has not been retried before. Successful retries also free up space for `jobLimit`.
+- (void)retryWithDestination:(nullable NSURLRequest *)destination NS_SWIFT_NAME(retry(destination:));
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_26.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHError.h /Applications/Xcode_26.1.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHError.h
--- /Applications/Xcode_26.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHError.h 2025-09-08 07:45:55
+++ /Applications/Xcode_26.1.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHError.h 2025-09-29 06:22:54
@@ -32,6 +32,7 @@
PHPhotosErrorMissingResource API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3303, // Asset resource missing
PHPhotosErrorNotEnoughSpace API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3305, // Not enough space to perform the requested change
PHPhotosErrorRequestNotSupportedForAsset API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3306, // The request could not be completed because it is not supported for the specified asset
+ PHPhotosErrorLimitExceeded API_AVAILABLE(macos(26.1), ios(26.1), tvos(26.1)) = 3307, // The request could not be completed because a limit would be exceeded
PHPhotosErrorAccessRestricted API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3310, // Access restricted by system configuration
PHPhotosErrorAccessUserDenied API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3311, // The user has denied access
diff -ruN /Applications/Xcode_26.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h /Applications/Xcode_26.1.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h
--- /Applications/Xcode_26.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h 2025-09-12 05:46:00
+++ /Applications/Xcode_26.1.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h 2025-09-30 08:57:29
@@ -68,6 +68,21 @@
+ (PHAuthorizationStatus)authorizationStatus API_DEPRECATED_WITH_REPLACEMENT("+authorizationStatusForAccessLevel:", ios(8, API_TO_BE_DEPRECATED), macos(10.13, API_TO_BE_DEPRECATED), tvos(10, API_TO_BE_DEPRECATED));
+ (void)requestAuthorization:(void(^)(PHAuthorizationStatus status))handler API_DEPRECATED_WITH_REPLACEMENT("+requestAuthorizationForAccessLevel:handler:", ios(8, API_TO_BE_DEPRECATED), macos(10.13, API_TO_BE_DEPRECATED), tvos(10, API_TO_BE_DEPRECATED));
+#if TARGET_OS_IOS && !TARGET_OS_VISION
+#pragma mark - Background Upload Jobs
+
+@property (readonly, getter=isUploadJobExtensionEnabled) BOOL uploadJobExtensionEnabled API_AVAILABLE(ios(26.1)) API_UNAVAILABLE(macos, macCatalyst, tvos, visionos) NS_SWIFT_NAME(uploadJobExtensionEnabled); /// Returns `YES` if the extension is enabled and active, otherwise `NO`. This is used by the extension's host application to determine the background processing status.
+
+/// Enables or disables the background asset resource upload job processing. This must be called before creating `PHAssetResourceUploadJob`, by the extension's host application.
+///
+/// Enabling BackgroundUploadJobs requires full library access and the extension registered to the extension point: "com.apple.photos.background-upload".
+///
+/// - Parameters:
+/// - enable: YES to enable the upload job extension processing and allow the creation of PHAssetResourceUploadJobs. NO to disable processing the host application's extension.
+/// - error: If enabling or disabling was unsuccessful, `NO` is returned and an error is set on the `error` parameter.
+- (BOOL)setUploadJobExtensionEnabled:(BOOL)enable error:(NSError * __autoreleasing *)error API_AVAILABLE(ios(26.1)) API_UNAVAILABLE(macos, macCatalyst, tvos, visionos);
+#endif
+
#pragma mark - Library availability
@property (readonly, atomic, nullable, strong) NSError *unavailabilityReason API_AVAILABLE(macos(10.15), ios(13), tvos(13));
diff -ruN /Applications/Xcode_26.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.h /Applications/Xcode_26.1.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.h
--- /Applications/Xcode_26.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.h 2025-09-12 05:46:00
+++ /Applications/Xcode_26.1.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.h 2025-09-30 08:57:28
@@ -29,6 +29,10 @@
#import <Photos/PHAssetChangeRequest.h>
#import <Photos/PHAssetCreationRequest.h>
#import <Photos/PHAssetCollectionChangeRequest.h>
+
+#import <Photos/PHAssetResourceUploadJob.h>
+#import <Photos/PHAssetResourceUploadJobChangeRequest.h>
+
#import <Photos/PHCollectionListChangeRequest.h>
#import <Photos/PHLivePhotoEditingContext.h>
diff -ruN /Applications/Xcode_26.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h /Applications/Xcode_26.1.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h
--- /Applications/Xcode_26.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h 2025-09-12 05:46:01
+++ /Applications/Xcode_26.1.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h 2025-09-30 05:37:55
@@ -11,7 +11,6 @@
#import <Foundation/Foundation.h>
-
API_AVAILABLE_BEGIN(macos(10.11), ios(8), tvos(10))
#pragma mark - PHCollectionListTypes
@@ -191,6 +190,23 @@
PHAssetResourceTypePhotoProxy API_AVAILABLE(macos(14), ios(17))= 19,
} API_AVAILABLE(ios(9));
+
+#pragma mark - PHAssetResourceUploadJob types
+
+/// The states of an upload job.
+typedef NS_ENUM(NSInteger, PHAssetResourceUploadJobState) {
+ PHAssetResourceUploadJobStateRegistered = 1, /// The job has been registered.
+ PHAssetResourceUploadJobStatePending = 2, /// A request has been made to send the asset resource to the destination, but has not yet been fulfilled.
+ PHAssetResourceUploadJobStateFailed = 3, /// The job has failed to send over.
+ PHAssetResourceUploadJobStateSucceeded = 4, /// The job has sent over successfully.
+
+} NS_SWIFT_NAME(PHAssetResourceUploadJob.State) API_AVAILABLE(ios(26.1)) API_UNAVAILABLE(macos, macCatalyst, tvos, visionos);
+
+/// These actions correspond with the types of fetches we can make on a PHAssetResourceUploadJob and the actions we can also take on those jobs.
+typedef NS_ENUM(NSInteger, PHAssetResourceUploadJobAction) {
+ PHAssetResourceUploadJobActionAcknowledge = 1, /// Where PHAssetResourceUploadJobState = (success OR fail).
+ PHAssetResourceUploadJobActionRetry = 2, /// Where PHAssetResourceUploadJobState = failed, but the job can be retried
+} NS_SWIFT_NAME(PHAssetResourceUploadJob.Action) API_AVAILABLE(ios(26.1)) API_UNAVAILABLE(macos, macCatalyst, tvos, visionos);
API_AVAILABLE_END