diff --git a/src/HomeKit/HMHome.cs b/src/HomeKit/HMHome.cs index 8082958f93..0a4f8d9a66 100644 --- a/src/HomeKit/HMHome.cs +++ b/src/HomeKit/HMHome.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; using ObjCRuntime; using Foundation; @@ -80,5 +81,21 @@ namespace HomeKit { return GetServices (arr.ToArray ()); } + + [NoTV] + [NoWatch] + [Introduced (PlatformName.iOS, 8,0, PlatformArchitecture.All, message: "This API in now prohibited on iOS. Use 'ManageUsers' instead.")] + [Obsoleted (PlatformName.iOS, 9,0, PlatformArchitecture.All, message: "This API in now prohibited on iOS. Use 'ManageUsers' instead.")] + public virtual void RemoveUser (HMUser user, Action completion) { + throw new NotSupportedException (); + } + + [NoTV] + [NoWatch] + [Introduced (PlatformName.iOS, 8,0, PlatformArchitecture.All, message: "This API in now prohibited on iOS. Use 'ManageUsers' instead.")] + [Obsoleted (PlatformName.iOS, 9,0, PlatformArchitecture.All, message: "This API in now prohibited on iOS. Use 'ManageUsers' instead.")] + public virtual Task RemoveUserAsync (HMUser user) { + throw new NotSupportedException (); + } } } diff --git a/src/homekit.cs b/src/homekit.cs index a6545ee4ad..3a3ac3a8a1 100644 --- a/src/homekit.cs +++ b/src/homekit.cs @@ -719,13 +719,6 @@ namespace HomeKit { [Export ("addUserWithCompletionHandler:")] void AddUser (Action completion); - [NoTV] - [NoWatch] - [Availability (Introduced = Platform.iOS_8_0, Deprecated = Platform.iOS_9_0, Message = "Use 'ManageUsers' instead.")] - [Async] - [Export ("removeUser:completionHandler:")] - void RemoveUser (HMUser user, Action completion); - [iOS (9,0)] [Export ("currentUser", ArgumentSemantic.Strong)] HMUser CurrentUser { get; } diff --git a/tests/xtro-sharpie/iOS-HomeKit.ignore b/tests/xtro-sharpie/iOS-HomeKit.ignore new file mode 100644 index 0000000000..5d64a59fbc --- /dev/null +++ b/tests/xtro-sharpie/iOS-HomeKit.ignore @@ -0,0 +1,2 @@ +## API prohibited on iOS since Xcode 10 +!missing-selector! HMHome::removeUser:completionHandler: not bound \ No newline at end of file