Skip to content

NearbyInteraction macOS xcode13.0 beta1

Manuel de la Pena edited this page Aug 5, 2021 · 3 revisions

#NearbyInteraction.framework https://github.com/xamarin/xamarin-macios/pull/12351

diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NIConfiguration.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NIConfiguration.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NIConfiguration.h	2021-03-16 09:53:46.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NIConfiguration.h	2021-06-02 11:06:15.000000000 -0400
@@ -13,7 +13,7 @@
 /**
  A type used to uniquely discover and identify a device in a nearby interaction session.
 */
-API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(macos, watchos, tvos)
+API_AVAILABLE(ios(14.0), watchos(7.3)) API_UNAVAILABLE(macos, tvos)
 NI_EXPORT
 @interface NIDiscoveryToken : NSObject <NSCopying, NSSecureCoding>
 
@@ -26,7 +26,7 @@
 /**
  An object to describe and configure parameters to be used in a nearby interaction session.
 */
-API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(macos, watchos, tvos)
+API_AVAILABLE(ios(14.0), watchos(7.3)) API_UNAVAILABLE(macos, tvos)
 NI_EXPORT
 @interface NIConfiguration : NSObject <NSCopying, NSSecureCoding>
 
@@ -40,7 +40,7 @@
  An object to describe and configure parameters to be used in a nearby interaction session for mutual relative positional measurements.
  @discussion Devices engaged in a session run with an NINearbyPeerConfiguration are able to continuously generate positional measurements relative to one another.
 */
-API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(macos, watchos, tvos)
+API_AVAILABLE(ios(14.0), watchos(7.3)) API_UNAVAILABLE(macos, tvos)
 NI_EXPORT
 @interface NINearbyPeerConfiguration : NIConfiguration
 
@@ -61,5 +61,33 @@
 
 @end
 
+/**
+ A session configuration that enables interaction with supported accessories.
+*/
+API_AVAILABLE(ios(15.0), watchos(8.0)) API_UNAVAILABLE(tvos, macos)
+NI_EXPORT
+@interface NINearbyAccessoryConfiguration : NIConfiguration
+
+/**
+ The discovery token identifying the accessory device for this session configuration.
+ @discussion NINearbyObject updates for this accessory will contain this discovery token.
+*/
+@property (nonatomic, copy, readonly) NIDiscoveryToken *accessoryDiscoveryToken;
+
+/**
+Create a new nearby accessory configuration using data received from the accessory.
+
+@param data Configuration data received from the accessory.
+@param error An optional out error parameter that will be populated with an error if the provided data is invalid or unsupported.
+*/
+- (nullable instancetype)initWithData:(NSData *)data error:(NSError **)error;
+
+/** Unavailable */
+- (instancetype)init NS_UNAVAILABLE;
++ (instancetype)new NS_UNAVAILABLE;
+
+@end
+
+
 
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NIError.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NIError.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NIError.h	2021-03-16 09:53:46.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NIError.h	2021-06-02 11:06:15.000000000 -0400
@@ -10,13 +10,13 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(macos, watchos, tvos)
+API_AVAILABLE(ios(14.0), watchos(7.3)) API_UNAVAILABLE(macos, tvos)
 NI_EXPORT NSErrorDomain const NIErrorDomain;
 
 /**
  Error codes for nearby interaction session failures.
  */
-API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(macos, watchos, tvos)
+API_AVAILABLE(ios(14.0), watchos(7.3)) API_UNAVAILABLE(macos, tvos)
 typedef NS_ERROR_ENUM(NIErrorDomain, NIErrorCode) {
     /** The platform does not support this operation */
     NIErrorCodeUnsupportedPlatform = -5889,
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NINearbyObject.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NINearbyObject.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NINearbyObject.h	2021-03-16 09:53:46.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NINearbyObject.h	2021-06-02 11:06:15.000000000 -0400
@@ -14,17 +14,17 @@
 @class NIDiscoveryToken;
 
 /** A sentinel value indicating that a distance measurement could not be produced */
-API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(macos, watchos, tvos)
+API_AVAILABLE(ios(14.0), watchos(7.3)) API_UNAVAILABLE(macos, tvos)
 NI_EXPORT float NINearbyObjectDistanceNotAvailable NS_SWIFT_UNAVAILABLE("Use optional value semantics");
 
 /** A sentinel value indicating that a direction measurement could not be produced */
-API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(macos, watchos, tvos)
+API_AVAILABLE(ios(14.0), watchos(7.3)) API_UNAVAILABLE(macos, tvos)
 NI_EXPORT simd_float3 NINearbyObjectDirectionNotAvailable NS_SWIFT_UNAVAILABLE("Use optional value semantics");
 
 /**
  A nearby object with distance and direction measurements.
 */
-API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(macos, watchos, tvos)
+API_AVAILABLE(ios(14.0), watchos(7.3)) API_UNAVAILABLE(macos, tvos)
 NI_EXPORT
 @interface NINearbyObject : NSObject <NSCopying, NSSecureCoding>
 
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NISession.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NISession.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NISession.h	2021-03-16 08:44:22.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/NearbyInteraction.framework/Headers/NISession.h	2021-06-02 07:35:43.000000000 -0400
@@ -18,7 +18,7 @@
 /**
  Nearby interaction session.
  */
-API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(macos, watchos, tvos)
+API_AVAILABLE(ios(14.0), watchos(7.3)) API_UNAVAILABLE(macos, tvos)
 NI_EXPORT
 @interface NISession : NSObject
 
@@ -39,7 +39,7 @@
 @property (nonatomic, strong, nullable) dispatch_queue_t delegateQueue;
 
 /**
- A unique nearby interaction identifer for this session.
+ A unique nearby interaction identifier for this session.
 
  @discussion Copy this discoveryToken and share it with a peer device.
  The discoveryToken is unique to this device and this session.
@@ -76,7 +76,7 @@
 /**
  Reasons to remove a nearby object.
  */
-API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(macos, watchos, tvos)
+API_AVAILABLE(ios(14.0), watchos(7.3)) API_UNAVAILABLE(macos, tvos)
 typedef NS_ENUM(NSInteger, NINearbyObjectRemovalReason) {
 
     /** The system has not received new activity from this object for over the allowed period. */
@@ -90,7 +90,7 @@
 /**
  Delegate for nearby interaction session updates.
  */
-API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(macos, watchos, tvos)
+API_AVAILABLE(ios(14.0), watchos(7.3)) API_UNAVAILABLE(macos, tvos)
 @protocol NISessionDelegate <NSObject>
 
 @optional
@@ -132,6 +132,19 @@
 */
 - (void)session:(NISession *)session didInvalidateWithError:(NSError *)error NS_SWIFT_NAME(session(_:didInvalidateWith:));
 
+/**
+Provides configuration data that needs to be shared with the accessory.
+@note Shareable configuration data is only provided when running an NINearbyAccessoryConfiguration.
+@discussion After invoking this callback, the session will go into a special preparedness state for a limited amount of time.
+The interaction on the accessory must start within this time window. If activity is not detected from the accessory, the session will call
+the -[session:didRemoveNearbyObjects:reason:] delegate callback. To restart the session, coordinate with the accessory and call -[runWithConfiguration] again.
+ 
+@param session The session which produced the configuration data.
+@param shareableConfigurationData The configuration data that needs to be shared with the accessory.
+@param object A representation of the accessory as a NINearbyObject. The discoveryToken property will be equal to the one in the configuration used to run the session.
+*/
+- (void)session:(NISession *)session didGenerateShareableConfigurationData:(NSData *)shareableConfigurationData forObject:(NINearbyObject *)object API_AVAILABLE(ios(15.0), watchos(8.0)) API_UNAVAILABLE(tvos, macos);
+
 @end
 
 NS_ASSUME_NONNULL_END
Clone this wiki locally