diff --git a/Parse/Parse/Internal/Commands/CommandRunner/URLRequestConstructor/PFCommandURLRequestConstructor.m b/Parse/Parse/Internal/Commands/CommandRunner/URLRequestConstructor/PFCommandURLRequestConstructor.m index 7457445e3..9b8260a0d 100644 --- a/Parse/Parse/Internal/Commands/CommandRunner/URLRequestConstructor/PFCommandURLRequestConstructor.m +++ b/Parse/Parse/Internal/Commands/CommandRunner/URLRequestConstructor/PFCommandURLRequestConstructor.m @@ -133,6 +133,8 @@ + (NSDictionary *)defaultURLRequestHeadersForApplicationId:(NSString *)applicati NSString *versionPrefix = @"apple-tv"; #elif TARGET_OS_WATCH NSString *versionPrefix = @"apple-watch"; +#elif TARGET_OS_VISION + NSString *versionPrefix = @"vision"; #endif NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary]; diff --git a/Parse/Parse/Internal/PFApplication.h b/Parse/Parse/Internal/PFApplication.h index ec601aa02..592bffaa5 100644 --- a/Parse/Parse/Internal/PFApplication.h +++ b/Parse/Parse/Internal/PFApplication.h @@ -11,7 +11,7 @@ #import "PFConstants.h" -#if TARGET_OS_IOS || TARGET_OS_TV +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_VISION #import #elif TARGET_OS_WATCH @class UIApplication; diff --git a/Parse/Parse/Internal/PFApplication.m b/Parse/Parse/Internal/PFApplication.m index 925b7a23d..5e5c13f29 100644 --- a/Parse/Parse/Internal/PFApplication.m +++ b/Parse/Parse/Internal/PFApplication.m @@ -9,7 +9,7 @@ #import "PFApplication.h" -#if TARGET_OS_IOS || TARGET_OS_TV +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_VISION #import #elif PF_TARGET_OS_OSX #import diff --git a/Parse/Parse/Internal/PFDevice.m b/Parse/Parse/Internal/PFDevice.m index 76832c172..5b3d7520a 100644 --- a/Parse/Parse/Internal/PFDevice.m +++ b/Parse/Parse/Internal/PFDevice.m @@ -13,7 +13,7 @@ #if TARGET_OS_WATCH #import -#elif TARGET_OS_IOS || TARGET_OS_TV +#elif TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_VISION #import #elif PF_TARGET_OS_OSX #import @@ -77,7 +77,7 @@ - (NSString *)detailedModel { if (!name) { #if TARGET_OS_WATCH name = [WKInterfaceDevice currentDevice].model; -#elif TARGET_OS_IOS || TARGET_OS_TV +#elif TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_VISION name = [UIDevice currentDevice].model; #elif TARGET_OS_MAC name = @"Mac"; @@ -95,7 +95,7 @@ - (NSString *)operatingSystemFullVersion { return version; } - (NSString *)operatingSystemVersion { -#if TARGET_OS_IOS +#if TARGET_OS_IOS || TARGET_OS_VISION return [UIDevice currentDevice].systemVersion; #elif TARGET_OS_WATCH || TARGET_OS_TV NSOperatingSystemVersion version = [NSProcessInfo processInfo].operatingSystemVersion; diff --git a/Parse/Parse/Source/PFAnalytics.m b/Parse/Parse/Source/PFAnalytics.m index 314f2633a..69089763d 100644 --- a/Parse/Parse/Source/PFAnalytics.m +++ b/Parse/Parse/Source/PFAnalytics.m @@ -29,7 +29,7 @@ @implementation PFAnalytics ///-------------------------------------- + (BFTask *)trackAppOpenedWithLaunchOptions:(nullable NSDictionary *)launchOptions { -#if TARGET_OS_WATCH || TARGET_OS_TV +#if TARGET_OS_WATCH || TARGET_OS_TV || TARGET_OS_VISION NSDictionary *userInfo = nil; #elif TARGET_OS_IOS NSDictionary *userInfo = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]; diff --git a/Parse/Parse/Source/PFConstants.h b/Parse/Parse/Source/PFConstants.h index bce859f40..800756345 100644 --- a/Parse/Parse/Source/PFConstants.h +++ b/Parse/Parse/Source/PFConstants.h @@ -462,9 +462,12 @@ extern NSString *const _Nonnull PFNetworkNotificationURLResponseBodyUserInfoKey; #ifndef TARGET_OS_TV # define TARGET_OS_TV 0 #endif +#ifndef TARGET_OS_VISION +# define TARGET_OS_VISION 0 +#endif #ifndef PF_TARGET_OS_OSX -# define PF_TARGET_OS_OSX (TARGET_OS_MAC && !TARGET_OS_IOS && !TARGET_OS_WATCH && !TARGET_OS_TV) +# define PF_TARGET_OS_OSX (TARGET_OS_MAC && !TARGET_OS_IOS && !TARGET_OS_WATCH && !TARGET_OS_TV && !TARGET_OS_VISION) #endif ///-------------------------------------- @@ -487,6 +490,22 @@ extern NSString *const _Nonnull PFNetworkNotificationURLResponseBodyUserInfoKey; # endif #endif +#ifndef PF_VISION_UNAVAILABLE +# ifdef __VISION_UNAVILABLE +# define PF_VISION_UNAVAILABLE __VISION_UNAVAILABLE +# else +# define PF_VISION_UNAVAILABLE +# endif +#endif + +#ifndef PF_VISION_UNAVAILABLE_WARNING +# if TARGET_OS_VISION +# define PF_VISION_UNAVAILABLE_WARNING _Pragma("GCC warning \"This file is unavailable on visionOS.\"") +# else +# define PF_VISION_UNAVAILABLE_WARNING +# endif +#endif + #ifndef PF_OSX_UNAVAILABLE # if PF_TARGET_OS_OSX # define PF_OSX_UNAVAILABLE __OSX_UNAVAILABLE diff --git a/Parse/Parse/Source/PFConstants.m b/Parse/Parse/Source/PFConstants.m index 814580f62..005544d28 100644 --- a/Parse/Parse/Source/PFConstants.m +++ b/Parse/Parse/Source/PFConstants.m @@ -17,6 +17,8 @@ NSString *const kPFDeviceType = @"tvos"; #elif TARGET_OS_WATCH NSString *const kPFDeviceType = @"applewatch"; +#elif TARGET_OS_VISION +NSString *const kPFDeviceType = @"vision"; #endif NSString *const PFParseErrorDomain = @"Parse"; diff --git a/Parse/Parse/Source/PFInstallation.m b/Parse/Parse/Source/PFInstallation.m index 263706ee6..b88fc92f3 100644 --- a/Parse/Parse/Source/PFInstallation.m +++ b/Parse/Parse/Source/PFInstallation.m @@ -9,7 +9,7 @@ #import "PFConstants.h" -#if TARGET_OS_IOS || PF_TARGET_OS_OSX || TARGET_OS_TV +#if TARGET_OS_IOS || PF_TARGET_OS_OSX || TARGET_OS_TV || TARGET_OS_VISION #import "PFInstallation.h" #import "PFInstallationPrivate.h" diff --git a/Parse/Parse/Source/PFPush.m b/Parse/Parse/Source/PFPush.m index ce66fded2..2eff33edd 100644 --- a/Parse/Parse/Source/PFPush.m +++ b/Parse/Parse/Source/PFPush.m @@ -9,7 +9,7 @@ #import "PFConstants.h" -#if TARGET_OS_IOS || PF_TARGET_OS_OSX || TARGET_OS_TV +#if TARGET_OS_IOS || PF_TARGET_OS_OSX || TARGET_OS_TV || TARGET_OS_VISION #import "PFPush.h" #import "PFPushPrivate.h" diff --git a/README.md b/README.md index 0bd40ec68..827858ddf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![parse-repository-header-sdk-apple](https://user-images.githubusercontent.com/5673677/198421762-993c89e8-8201-40f1-a650-c2e9dde4da82.png) -

iOS · iPadOS · macOS · watchOS · tvOS

+

iOS · iPadOS · macOS · watchOS · tvOS · visionOS

--- @@ -27,7 +27,7 @@ --- -A library that gives you access to the powerful Parse Server backend from your iOS, iPadOS, macOS, watchOS and tvOS app. For more information about the Parse Platform and its features, see the public [documentation][docs]. +A library that gives you access to the powerful Parse Server backend from your iOS, iPadOS, macOS, watchOS, tvOS, and visionOS app. For more information about the Parse Platform and its features, see the public [documentation][docs]. ---