From cbe0c370d3bae9d3c5efece250ca6ec2f8016f8c Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 19 Jul 2022 11:31:05 -0400 Subject: [PATCH 1/2] [UserNotitications] Add support for Xcode 14 beta 1,2 & 3 --- src/usernotifications.cs | 19 +++++++++++++++++++ .../iOS-UserNotifications.todo | 5 ----- .../macOS-UserNotifications.todo | 6 ------ .../tvOS-UserNotifications.todo | 5 ----- tests/xtro-sharpie/iOS-UserNotifications.todo | 5 ----- .../macOS-UserNotifications.ignore | 1 + .../xtro-sharpie/macOS-UserNotifications.todo | 6 ------ .../tvOS-UserNotifications.ignore | 1 + .../xtro-sharpie/tvOS-UserNotifications.todo | 5 ----- ....todo => watchOS-UserNotifications.ignore} | 4 ---- 10 files changed, 21 insertions(+), 36 deletions(-) delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/iOS-UserNotifications.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/macOS-UserNotifications.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/tvOS-UserNotifications.todo delete mode 100644 tests/xtro-sharpie/iOS-UserNotifications.todo create mode 100644 tests/xtro-sharpie/macOS-UserNotifications.ignore delete mode 100644 tests/xtro-sharpie/macOS-UserNotifications.todo create mode 100644 tests/xtro-sharpie/tvOS-UserNotifications.ignore delete mode 100644 tests/xtro-sharpie/tvOS-UserNotifications.todo rename tests/xtro-sharpie/{watchOS-UserNotifications.todo => watchOS-UserNotifications.ignore} (53%) diff --git a/src/usernotifications.cs b/src/usernotifications.cs index 0f572db0849d..0efa551b9fbd 100644 --- a/src/usernotifications.cs +++ b/src/usernotifications.cs @@ -43,6 +43,7 @@ public enum UNErrorCode : long { NotificationInvalidNoContent, ContentProvidingObjectNotAllowed = 1500, ContentProvidingInvalid = 1501, + BadgeInputInvalid = 1600, } [iOS (10, 0)] @@ -131,6 +132,10 @@ public enum UNAuthorizationOptions : ulong { [iOS (12, 0), TV(12,0), Watch (5,0)] Provisional = (1 << 6), [iOS (13,0)][TV (13,0)][Watch (6,0)] + [Deprecated (PlatformName.iOS, 15,0, message: "Announcement is always included.")] + [Deprecated (PlatformName.TvOS, 15,0, message: "Announcement is always included.")] + [Deprecated (PlatformName.WatchOS, 7,0, message: "Announcement is always included.")] + [Deprecated (PlatformName.MacOSX, 15,0, message: "Announcement is always included.")] Announcement = (1 << 7), [iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0), Watch (8,0)] TimeSensitive = (1 << 8), @@ -437,6 +442,11 @@ interface UNNotificationContent : NSCopying, NSMutableCopying, NSSecureCoding { [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] [Export ("relevanceScore")] double RelevanceScore { get; } + + [Watch (9,0), NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("filterCriteria")] + [NullAllowed] + string FilterCriteria { get; } } [iOS (10, 0)] @@ -507,6 +517,10 @@ interface UNMutableNotificationContent { [iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0), Watch (8,0)] [Export ("relevanceScore")] double RelevanceScore { get; set; } + + [Watch (9,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [NullAllowed, Export ("filterCriteria")] + string FilterCriteria { get; set; } } [iOS (10, 0)] @@ -882,6 +896,11 @@ interface UNUserNotificationCenter { [Unavailable (PlatformName.TvOS)] [Export ("removeAllDeliveredNotifications")] void RemoveAllDeliveredNotifications (); + + [Async] + [TV (16,0), NoWatch, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("setBadgeCount:withCompletionHandler:")] + void SetBadgeCount (nint newBadgeCount, [NullAllowed] Action completionHandler); } [iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0), Watch (8,0)] diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-UserNotifications.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-UserNotifications.todo deleted file mode 100644 index 108058f4df59..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-UserNotifications.todo +++ /dev/null @@ -1,5 +0,0 @@ -!missing-selector! UNMutableNotificationContent::filterCriteria not bound -!missing-selector! UNMutableNotificationContent::setFilterCriteria: not bound -!missing-selector! UNNotificationContent::filterCriteria not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeBadgeInputInvalid = 1600 not bound -!missing-selector! UNUserNotificationCenter::setBadgeCount:withCompletionHandler: not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-UserNotifications.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-UserNotifications.todo deleted file mode 100644 index 3dbfe080c37f..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-UserNotifications.todo +++ /dev/null @@ -1,6 +0,0 @@ -!extra-enum-value! Managed value 128 for UNAuthorizationOptions.Announcement is available for the current platform while the value in the native header is not -!missing-selector! UNMutableNotificationContent::filterCriteria not bound -!missing-selector! UNMutableNotificationContent::setFilterCriteria: not bound -!missing-selector! UNNotificationContent::filterCriteria not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeBadgeInputInvalid = 1600 not bound -!missing-selector! UNUserNotificationCenter::setBadgeCount:withCompletionHandler: not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UserNotifications.todo b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UserNotifications.todo deleted file mode 100644 index 5ac878352c0f..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UserNotifications.todo +++ /dev/null @@ -1,5 +0,0 @@ -!extra-enum-value! Managed value 128 for UNAuthorizationOptions.Announcement is available for the current platform while the value in the native header is not -!missing-selector! UNMutableNotificationContent::filterCriteria not bound -!missing-selector! UNMutableNotificationContent::setFilterCriteria: not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeBadgeInputInvalid = 1600 not bound -!missing-selector! UNUserNotificationCenter::setBadgeCount:withCompletionHandler: not bound diff --git a/tests/xtro-sharpie/iOS-UserNotifications.todo b/tests/xtro-sharpie/iOS-UserNotifications.todo deleted file mode 100644 index 108058f4df59..000000000000 --- a/tests/xtro-sharpie/iOS-UserNotifications.todo +++ /dev/null @@ -1,5 +0,0 @@ -!missing-selector! UNMutableNotificationContent::filterCriteria not bound -!missing-selector! UNMutableNotificationContent::setFilterCriteria: not bound -!missing-selector! UNNotificationContent::filterCriteria not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeBadgeInputInvalid = 1600 not bound -!missing-selector! UNUserNotificationCenter::setBadgeCount:withCompletionHandler: not bound diff --git a/tests/xtro-sharpie/macOS-UserNotifications.ignore b/tests/xtro-sharpie/macOS-UserNotifications.ignore new file mode 100644 index 000000000000..98f837cd4d97 --- /dev/null +++ b/tests/xtro-sharpie/macOS-UserNotifications.ignore @@ -0,0 +1 @@ +!extra-enum-value! Managed value 128 for UNAuthorizationOptions.Announcement is available for the current platform while the value in the native header is not diff --git a/tests/xtro-sharpie/macOS-UserNotifications.todo b/tests/xtro-sharpie/macOS-UserNotifications.todo deleted file mode 100644 index 3dbfe080c37f..000000000000 --- a/tests/xtro-sharpie/macOS-UserNotifications.todo +++ /dev/null @@ -1,6 +0,0 @@ -!extra-enum-value! Managed value 128 for UNAuthorizationOptions.Announcement is available for the current platform while the value in the native header is not -!missing-selector! UNMutableNotificationContent::filterCriteria not bound -!missing-selector! UNMutableNotificationContent::setFilterCriteria: not bound -!missing-selector! UNNotificationContent::filterCriteria not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeBadgeInputInvalid = 1600 not bound -!missing-selector! UNUserNotificationCenter::setBadgeCount:withCompletionHandler: not bound diff --git a/tests/xtro-sharpie/tvOS-UserNotifications.ignore b/tests/xtro-sharpie/tvOS-UserNotifications.ignore new file mode 100644 index 000000000000..98f837cd4d97 --- /dev/null +++ b/tests/xtro-sharpie/tvOS-UserNotifications.ignore @@ -0,0 +1 @@ +!extra-enum-value! Managed value 128 for UNAuthorizationOptions.Announcement is available for the current platform while the value in the native header is not diff --git a/tests/xtro-sharpie/tvOS-UserNotifications.todo b/tests/xtro-sharpie/tvOS-UserNotifications.todo deleted file mode 100644 index 5ac878352c0f..000000000000 --- a/tests/xtro-sharpie/tvOS-UserNotifications.todo +++ /dev/null @@ -1,5 +0,0 @@ -!extra-enum-value! Managed value 128 for UNAuthorizationOptions.Announcement is available for the current platform while the value in the native header is not -!missing-selector! UNMutableNotificationContent::filterCriteria not bound -!missing-selector! UNMutableNotificationContent::setFilterCriteria: not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeBadgeInputInvalid = 1600 not bound -!missing-selector! UNUserNotificationCenter::setBadgeCount:withCompletionHandler: not bound diff --git a/tests/xtro-sharpie/watchOS-UserNotifications.todo b/tests/xtro-sharpie/watchOS-UserNotifications.ignore similarity index 53% rename from tests/xtro-sharpie/watchOS-UserNotifications.todo rename to tests/xtro-sharpie/watchOS-UserNotifications.ignore index 4b81c59b89dc..39de7bdd605a 100644 --- a/tests/xtro-sharpie/watchOS-UserNotifications.todo +++ b/tests/xtro-sharpie/watchOS-UserNotifications.ignore @@ -1,6 +1,2 @@ !extra-enum-value! Managed value 4 for UNNotificationCategoryOptions.HiddenPreviewsShowTitle is available for the current platform while the value in the native header is not !extra-enum-value! Managed value 8 for UNNotificationCategoryOptions.HiddenPreviewsShowSubtitle is available for the current platform while the value in the native header is not -!missing-selector! UNMutableNotificationContent::filterCriteria not bound -!missing-selector! UNMutableNotificationContent::setFilterCriteria: not bound -!missing-selector! UNNotificationContent::filterCriteria not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeBadgeInputInvalid = 1600 not bound From a34aad88d98ccac7611b5e4f6659b9c8bb032bc1 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 19 Jul 2022 11:33:37 -0400 Subject: [PATCH 2/2] Update src/usernotifications.cs --- src/usernotifications.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usernotifications.cs b/src/usernotifications.cs index 0efa551b9fbd..49f356262dc4 100644 --- a/src/usernotifications.cs +++ b/src/usernotifications.cs @@ -518,7 +518,7 @@ interface UNMutableNotificationContent { [Export ("relevanceScore")] double RelevanceScore { get; set; } - [Watch (9,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [TV(16,0), Watch (9,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] [NullAllowed, Export ("filterCriteria")] string FilterCriteria { get; set; } }