2727
2828#pragma mark - AppleAuthManager Implementation
2929
30- // IOS/TVOS 13.0 | MACOS 10.15
31- #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 || __TV_OS_VERSION_MAX_ALLOWED >= 130000 || __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
30+ // IOS/TVOS 13.0 | MACOS 10.15 | VISIONOS 1.0
31+ #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 || __TV_OS_VERSION_MAX_ALLOWED >= 130000 || __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500 || __VISION_OS_VERSION_MAX_ALLOWED >= 10000
3232#define AUTHENTICATION_SERVICES_AVAILABLE true
3333#import < AuthenticationServices/AuthenticationServices.h>
3434#endif
@@ -45,7 +45,7 @@ - (void) sendsLoginResponseInternalErrorWithCode:(NSInteger)code andMessage:(NSS
4545@end
4646
4747#if AUTHENTICATION_SERVICES_AVAILABLE
48- API_AVAILABLE (ios(13.0 ), macos(10.15 ), tvos(13.0 ), watchos(6.0 ))
48+ API_AVAILABLE (ios(13.0 ), macos(10.15 ), tvos(13.0 ), watchos(6.0 ), visionos( 1.0 ) )
4949@interface AppleAuthManager () <ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding>
5050@property (nonatomic, strong) ASAuthorizationAppleIDProvider *appleIdProvider;
5151@property (nonatomic, strong) ASAuthorizationPasswordProvider *passwordProvider;
@@ -74,7 +74,7 @@ - (instancetype) init
7474 if (self)
7575 {
7676#if AUTHENTICATION_SERVICES_AVAILABLE
77- if (@available (iOS 13.0 , tvOS 13.0 , macOS 10.15 , *))
77+ if (@available (iOS 13.0 , tvOS 13.0 , macOS 10.15 , visionOS 1.0 , *))
7878 {
7979 _appleIdProvider = [[ASAuthorizationAppleIDProvider alloc ] init ];
8080 _passwordProvider = [[ASAuthorizationPasswordProvider alloc ] init ];
@@ -90,7 +90,7 @@ - (instancetype) init
9090- (void ) quickLogin : (uint)requestId withNonce : (NSString *)nonce andState : (NSString *)state
9191{
9292#if AUTHENTICATION_SERVICES_AVAILABLE
93- if (@available (iOS 13.0 , tvOS 13.0 , macOS 10.15 , *))
93+ if (@available (iOS 13.0 , tvOS 13.0 , macOS 10.15 , visionOS 1.0 , *))
9494 {
9595 ASAuthorizationAppleIDRequest *appleIDRequest = [[self appleIdProvider ] createRequest ];
9696 [appleIDRequest setNonce: nonce];
@@ -117,7 +117,7 @@ - (void) quickLogin:(uint)requestId withNonce:(NSString *)nonce andState:(NSStri
117117- (void ) loginWithAppleId : (uint)requestId withOptions : (AppleAuthManagerLoginOptions)options nonce : (NSString *)nonce andState : (NSString *)state
118118{
119119#if AUTHENTICATION_SERVICES_AVAILABLE
120- if (@available (iOS 13.0 , tvOS 13.0 , macOS 10.15 , *))
120+ if (@available (iOS 13.0 , tvOS 13.0 , macOS 10.15 , visionOS 1.0 , *))
121121 {
122122 ASAuthorizationAppleIDRequest *request = [[self appleIdProvider ] createRequest ];
123123 NSMutableArray *scopes = [NSMutableArray array ];
@@ -152,7 +152,7 @@ - (void) loginWithAppleId:(uint)requestId withOptions:(AppleAuthManagerLoginOpti
152152- (void ) getCredentialStateForUser : (NSString *)userId withRequestId : (uint)requestId
153153{
154154#if AUTHENTICATION_SERVICES_AVAILABLE
155- if (@available (iOS 13.0 , tvOS 13.0 , macOS 10.15 , *))
155+ if (@available (iOS 13.0 , tvOS 13.0 , macOS 10.15 , visionOS 1.0 , *))
156156 {
157157 [[self appleIdProvider ] getCredentialStateForUserID: userId completion: ^(ASAuthorizationAppleIDProviderCredentialState credentialState, NSError * _Nullable error) {
158158 NSNumber *credentialStateNumber = nil ;
@@ -185,7 +185,7 @@ - (void) getCredentialStateForUser:(NSString *)userId withRequestId:(uint)reques
185185- (void ) registerCredentialsRevokedCallbackForRequestId : (uint)requestId
186186{
187187#if AUTHENTICATION_SERVICES_AVAILABLE
188- if (@available (iOS 13.0 , tvOS 13.0 , macOS 10.15 , *))
188+ if (@available (iOS 13.0 , tvOS 13.0 , macOS 10.15 , visionOS 1.0 , *))
189189 {
190190 if ([self credentialsRevokedObserver ])
191191 {
@@ -265,7 +265,7 @@ - (void) sendsLoginResponseInternalErrorWithCode:(NSInteger)code andMessage:(NSS
265265#if AUTHENTICATION_SERVICES_AVAILABLE
266266
267267- (void ) performAuthorizationRequestsForController : (ASAuthorizationController *)authorizationController withRequestId : (uint)requestId
268- API_AVAILABLE(ios(13.0 ), macos(10.15 ), tvos(13.0 ), watchos(6.0 ))
268+ API_AVAILABLE(ios(13.0 ), macos(10.15 ), tvos(13.0 ), watchos(6.0 ), visionos( 1.0 ) )
269269{
270270 NSValue *authControllerAsKey = [NSValue valueWithNonretainedObject: authorizationController];
271271 [[self authorizationsInProgress ] setObject: @(requestId) forKey: authControllerAsKey];
@@ -278,7 +278,7 @@ - (void) performAuthorizationRequestsForController:(ASAuthorizationController *)
278278#pragma mark ASAuthorizationControllerDelegate protocol implementation
279279
280280- (void ) authorizationController : (ASAuthorizationController *)controller didCompleteWithAuthorization : (ASAuthorization *)authorization
281- API_AVAILABLE(ios(13.0 ), macos(10.15 ), tvos(13.0 ), watchos(6.0 ))
281+ API_AVAILABLE(ios(13.0 ), macos(10.15 ), tvos(13.0 ), watchos(6.0 ), visionos( 1.0 ) )
282282{
283283 NSValue *authControllerAsKey = [NSValue valueWithNonretainedObject: controller];
284284 NSNumber *requestIdNumber = [[self authorizationsInProgress ] objectForKey: authControllerAsKey];
@@ -306,7 +306,7 @@ - (void) authorizationController:(ASAuthorizationController *)controller didComp
306306}
307307
308308- (void ) authorizationController : (ASAuthorizationController *)controller didCompleteWithError : (NSError *)error
309- API_AVAILABLE(ios(13.0 ), macos(10.15 ), tvos(13.0 ), watchos(6.0 ))
309+ API_AVAILABLE(ios(13.0 ), macos(10.15 ), tvos(13.0 ), watchos(6.0 ), visionos( 1.0 ) )
310310{
311311 NSValue *authControllerAsKey = [NSValue valueWithNonretainedObject: controller];
312312 NSNumber *requestIdNumber = [[self authorizationsInProgress ] objectForKey: authControllerAsKey];
@@ -326,9 +326,10 @@ - (void) authorizationController:(ASAuthorizationController *)controller didComp
326326#pragma mark ASAuthorizationControllerPresentationContextProviding protocol implementation
327327
328328- (ASPresentationAnchor) presentationAnchorForAuthorizationController : (ASAuthorizationController *)controller
329- API_AVAILABLE(ios(13.0 ), macos(10.15 ), tvos(13.0 ), watchos(6.0 ))
329+ API_AVAILABLE(ios(13.0 ), macos(10.15 ), tvos(13.0 ), watchos(6.0 ), visionos( 1.0 ) )
330330{
331- #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 || __TV_OS_VERSION_MAX_ALLOWED >= 130000
331+
332+ #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 || __TV_OS_VERSION_MAX_ALLOWED >= 130000 || __VISION_OS_VERSION_MAX_ALLOWED >= 10000
332333 return [[[UIApplication sharedApplication ] delegate ] window ];
333334 #elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
334335 return [[NSApplication sharedApplication ] mainWindow ];
@@ -343,9 +344,9 @@ - (ASPresentationAnchor) presentationAnchorForAuthorizationController:(ASAuthori
343344
344345#pragma mark - Native C Calls
345346
346- bool AppleAuth_IsCurrentPlatformSupported ()
347+ bool AppleAuth_IsCurrentPlatformSupported (void )
347348{
348- if (@available (iOS 13.0 , tvOS 13.0 , macOS 10.15 , *))
349+ if (@available (iOS 13.0 , tvOS 13.0 , macOS 10.15 , visionOS 1.0 , *))
349350 {
350351 return true ;
351352 }
0 commit comments