27
27
28
28
#pragma mark - AppleAuthManager Implementation
29
29
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
32
32
#define AUTHENTICATION_SERVICES_AVAILABLE true
33
33
#import < AuthenticationServices/AuthenticationServices.h>
34
34
#endif
@@ -45,7 +45,7 @@ - (void) sendsLoginResponseInternalErrorWithCode:(NSInteger)code andMessage:(NSS
45
45
@end
46
46
47
47
#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 ) )
49
49
@interface AppleAuthManager () <ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding>
50
50
@property (nonatomic, strong) ASAuthorizationAppleIDProvider *appleIdProvider;
51
51
@property (nonatomic, strong) ASAuthorizationPasswordProvider *passwordProvider;
@@ -74,7 +74,7 @@ - (instancetype) init
74
74
if (self)
75
75
{
76
76
#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 , *))
78
78
{
79
79
_appleIdProvider = [[ASAuthorizationAppleIDProvider alloc ] init ];
80
80
_passwordProvider = [[ASAuthorizationPasswordProvider alloc ] init ];
@@ -90,7 +90,7 @@ - (instancetype) init
90
90
- (void ) quickLogin : (uint)requestId withNonce : (NSString *)nonce andState : (NSString *)state
91
91
{
92
92
#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 , *))
94
94
{
95
95
ASAuthorizationAppleIDRequest *appleIDRequest = [[self appleIdProvider ] createRequest ];
96
96
[appleIDRequest setNonce: nonce];
@@ -117,7 +117,7 @@ - (void) quickLogin:(uint)requestId withNonce:(NSString *)nonce andState:(NSStri
117
117
- (void ) loginWithAppleId : (uint)requestId withOptions : (AppleAuthManagerLoginOptions)options nonce : (NSString *)nonce andState : (NSString *)state
118
118
{
119
119
#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 , *))
121
121
{
122
122
ASAuthorizationAppleIDRequest *request = [[self appleIdProvider ] createRequest ];
123
123
NSMutableArray *scopes = [NSMutableArray array ];
@@ -152,7 +152,7 @@ - (void) loginWithAppleId:(uint)requestId withOptions:(AppleAuthManagerLoginOpti
152
152
- (void ) getCredentialStateForUser : (NSString *)userId withRequestId : (uint)requestId
153
153
{
154
154
#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 , *))
156
156
{
157
157
[[self appleIdProvider ] getCredentialStateForUserID: userId completion: ^(ASAuthorizationAppleIDProviderCredentialState credentialState, NSError * _Nullable error) {
158
158
NSNumber *credentialStateNumber = nil ;
@@ -185,7 +185,7 @@ - (void) getCredentialStateForUser:(NSString *)userId withRequestId:(uint)reques
185
185
- (void ) registerCredentialsRevokedCallbackForRequestId : (uint)requestId
186
186
{
187
187
#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 , *))
189
189
{
190
190
if ([self credentialsRevokedObserver ])
191
191
{
@@ -265,7 +265,7 @@ - (void) sendsLoginResponseInternalErrorWithCode:(NSInteger)code andMessage:(NSS
265
265
#if AUTHENTICATION_SERVICES_AVAILABLE
266
266
267
267
- (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 ) )
269
269
{
270
270
NSValue *authControllerAsKey = [NSValue valueWithNonretainedObject: authorizationController];
271
271
[[self authorizationsInProgress ] setObject: @(requestId) forKey: authControllerAsKey];
@@ -278,7 +278,7 @@ - (void) performAuthorizationRequestsForController:(ASAuthorizationController *)
278
278
#pragma mark ASAuthorizationControllerDelegate protocol implementation
279
279
280
280
- (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 ) )
282
282
{
283
283
NSValue *authControllerAsKey = [NSValue valueWithNonretainedObject: controller];
284
284
NSNumber *requestIdNumber = [[self authorizationsInProgress ] objectForKey: authControllerAsKey];
@@ -306,7 +306,7 @@ - (void) authorizationController:(ASAuthorizationController *)controller didComp
306
306
}
307
307
308
308
- (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 ) )
310
310
{
311
311
NSValue *authControllerAsKey = [NSValue valueWithNonretainedObject: controller];
312
312
NSNumber *requestIdNumber = [[self authorizationsInProgress ] objectForKey: authControllerAsKey];
@@ -326,9 +326,10 @@ - (void) authorizationController:(ASAuthorizationController *)controller didComp
326
326
#pragma mark ASAuthorizationControllerPresentationContextProviding protocol implementation
327
327
328
328
- (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 ) )
330
330
{
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
332
333
return [[[UIApplication sharedApplication ] delegate ] window ];
333
334
#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
334
335
return [[NSApplication sharedApplication ] mainWindow ];
@@ -343,9 +344,9 @@ - (ASPresentationAnchor) presentationAnchorForAuthorizationController:(ASAuthori
343
344
344
345
#pragma mark - Native C Calls
345
346
346
- bool AppleAuth_IsCurrentPlatformSupported ()
347
+ bool AppleAuth_IsCurrentPlatformSupported (void )
347
348
{
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 , *))
349
350
{
350
351
return true ;
351
352
}
0 commit comments