diff --git a/src/usernotifications.cs b/src/usernotifications.cs index 6fe82c6f848c..fe0bb1df92fd 100644 --- a/src/usernotifications.cs +++ b/src/usernotifications.cs @@ -40,7 +40,9 @@ public enum UNErrorCode : long { AttachmentMoveIntoDataStoreFailed, AttachmentCorrupt, NotificationInvalidNoDate = 1400, - NotificationInvalidNoContent + NotificationInvalidNoContent, + ContentProvidingObjectNotAllowed = 1500, + ContentProvidingInvalid = 1501, } [iOS (10, 0)] @@ -130,6 +132,8 @@ public enum UNAuthorizationOptions : ulong { Provisional = (1 << 6), [iOS (13,0)][TV (13,0)][Watch (6,0)] Announcement = (1 << 7), + [iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0), Watch (8,0)] + TimeSensitive = (1 << 8), } [iOS (10, 0)] @@ -163,6 +167,16 @@ public enum UNShowPreviewsSetting : long Never } + [iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0), Watch (8,0)] + [Native] + public enum UNNotificationInterruptionLevel : long + { + Active, + Critical, + Passive, + TimeSensitive, + } + [iOS (10, 0)] [TV (10, 0)] [Watch (3, 0)] @@ -198,6 +212,15 @@ interface UNNotificationAction : NSCopying, NSSecureCoding { [Static] [Export ("actionWithIdentifier:title:options:")] UNNotificationAction FromIdentifier (string identifier, string title, UNNotificationActionOptions options); + + [Watch (8,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Static] + [Export ("actionWithIdentifier:title:options:icon:")] + UNNotificationAction FromIdentifier (string identifier, string title, UNNotificationActionOptions options, [NullAllowed] UNNotificationActionIcon icon); + + [Watch (8,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [NullAllowed, Export ("icon", ArgumentSemantic.Copy)] + UNNotificationActionIcon Icon { get; } } [iOS (10, 0)] @@ -212,6 +235,11 @@ interface UNTextInputNotificationAction { [Export ("actionWithIdentifier:title:options:textInputButtonTitle:textInputPlaceholder:")] UNTextInputNotificationAction FromIdentifier (string identifier, string title, UNNotificationActionOptions options, string textInputButtonTitle, string textInputPlaceholder); + [iOS (15,0), Mac (12,0), MacCatalyst (15,0), Watch (8,0)] + [Static] + [Export ("actionWithIdentifier:title:options:icon:textInputButtonTitle:textInputPlaceholder:")] + UNTextInputNotificationAction FromIdentifier (string identifier, string title, UNNotificationActionOptions options, [NullAllowed] UNNotificationActionIcon icon, string textInputButtonTitle, string textInputPlaceholder); + [Export ("textInputButtonTitle")] string TextInputButtonTitle { get; } @@ -382,10 +410,12 @@ interface UNNotificationContent : NSCopying, NSMutableCopying, NSSecureCoding { NSDictionary UserInfo { get; } [NoWatch, NoTV, iOS (12, 0)] + [Deprecated (PlatformName.iOS, 15, 0, message: "This property is ignored.")] [Export ("summaryArgument")] string SummaryArgument { get; } [NoWatch, NoTV, iOS (12, 0)] + [Deprecated (PlatformName.iOS, 15, 0, message: "This property is ignored.")] [Export ("summaryArgumentCount")] nuint SummaryArgumentCount { get; } @@ -394,6 +424,19 @@ interface UNNotificationContent : NSCopying, NSMutableCopying, NSSecureCoding { [Mac (10,15)] [NullAllowed, Export ("targetContentIdentifier")] string TargetContentIdentifier { get; [NotImplemented] set; } + + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("contentByUpdatingWithProvider:error:")] + [return: NullAllowed] + UNNotificationContent Update (IUNNotificationContentProviding fromProvider, [NullAllowed] out NSError outError); + + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("interruptionLevel", ArgumentSemantic.Assign)] + UNNotificationInterruptionLevel InterruptionLevel { get; } + + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("relevanceScore")] + double RelevanceScore { get; } } [iOS (10, 0)] @@ -442,10 +485,12 @@ interface UNMutableNotificationContent { NSDictionary UserInfo { get; set; } [NoWatch, NoTV, iOS (12, 0)] + [Deprecated (PlatformName.iOS, 15, 0, message: "This property is ignored.")] [Export ("summaryArgument")] string SummaryArgument { get; set; } [NoWatch, NoTV, iOS (12, 0)] + [Deprecated (PlatformName.iOS, 15, 0, message: "This property is ignored.")] [Export ("summaryArgumentCount")] nuint SummaryArgumentCount { get; set; } @@ -454,6 +499,14 @@ interface UNMutableNotificationContent { [Mac (10,15)] [NullAllowed, Export ("targetContentIdentifier")] string TargetContentIdentifier { get; set; } + + [iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0), Watch (8,0)] + [Export ("interruptionLevel", ArgumentSemantic.Assign)] + UNNotificationInterruptionLevel InterruptionLevel { get; set; } + + [iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0), Watch (8,0)] + [Export ("relevanceScore")] + double RelevanceScore { get; set; } } [iOS (10, 0)] @@ -605,6 +658,18 @@ interface UNNotificationSettings : NSCopying, NSSecureCoding { [Watch (6,0), NoTV, NoMac, iOS (13,0)] [Export ("announcementSetting")] UNNotificationSetting AnnouncementSetting { get; } + + [iOS (15,0), Mac (12,0), MacCatalyst (15,0), Watch (8,0), TV (15,0)] + [Export ("timeSensitiveSetting")] + UNNotificationSetting TimeSensitiveSetting { get; } + + [iOS (15,0), Mac (12,0), MacCatalyst (15,0), Watch (8,0), TV (15,0)] + [Export ("scheduledDeliverySetting")] + UNNotificationSetting ScheduledDeliverySetting { get; } + + [iOS (15,0), Mac (12,0), MacCatalyst (15,0), Watch (8,0), TV (15,0)] + [Export ("directMessagesSetting")] + UNNotificationSetting DirectMessagesSetting { get; } } [iOS (10, 0)] @@ -717,7 +782,7 @@ interface UNLocationNotificationTrigger { [Export ("region", ArgumentSemantic.Copy)] CLRegion Region { get; } - [Unavailable (PlatformName.WatchOS)] + [Watch (8,0)] [Static] [Export ("triggerWithRegion:repeats:")] UNLocationNotificationTrigger CreateTrigger (CLRegion region, bool repeats); @@ -807,5 +872,27 @@ interface UNUserNotificationCenter { [Export ("removeAllDeliveredNotifications")] void RemoveAllDeliveredNotifications (); } + + [iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0), Watch (8,0)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface UNNotificationActionIcon : NSCopying, NSSecureCoding + { + [Static] + [Export ("iconWithTemplateImageName:")] + UNNotificationActionIcon CreateFromTemplate (string imageName); + + [Static] + [Export ("iconWithSystemImageName:")] + UNNotificationActionIcon CreateFromSystem (string imageName); + } + + interface IUNNotificationContentProviding {} + + [iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0), Watch (8,0)] + [Protocol] + interface UNNotificationContentProviding + { + } } diff --git a/tests/xtro-sharpie/MacCatalyst-UserNotifications.todo b/tests/xtro-sharpie/MacCatalyst-UserNotifications.todo deleted file mode 100644 index 6a537bf00b3b..000000000000 --- a/tests/xtro-sharpie/MacCatalyst-UserNotifications.todo +++ /dev/null @@ -1,21 +0,0 @@ -!missing-enum! UNNotificationInterruptionLevel not bound -!missing-enum-value! UNAuthorizationOptions native value UNAuthorizationOptionTimeSensitive = 256 not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeContentProvidingInvalid = 1501 not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeContentProvidingObjectNotAllowed = 1500 not bound -!missing-protocol! UNNotificationContentProviding not bound -!missing-selector! +UNNotificationAction::actionWithIdentifier:title:options:icon: not bound -!missing-selector! +UNNotificationActionIcon::iconWithSystemImageName: not bound -!missing-selector! +UNNotificationActionIcon::iconWithTemplateImageName: not bound -!missing-selector! +UNTextInputNotificationAction::actionWithIdentifier:title:options:icon:textInputButtonTitle:textInputPlaceholder: not bound -!missing-selector! UNMutableNotificationContent::interruptionLevel not bound -!missing-selector! UNMutableNotificationContent::relevanceScore not bound -!missing-selector! UNMutableNotificationContent::setInterruptionLevel: not bound -!missing-selector! UNMutableNotificationContent::setRelevanceScore: not bound -!missing-selector! UNNotificationAction::icon not bound -!missing-selector! UNNotificationContent::contentByUpdatingWithProvider:error: not bound -!missing-selector! UNNotificationContent::interruptionLevel not bound -!missing-selector! UNNotificationContent::relevanceScore not bound -!missing-selector! UNNotificationSettings::directMessagesSetting not bound -!missing-selector! UNNotificationSettings::scheduledDeliverySetting not bound -!missing-selector! UNNotificationSettings::timeSensitiveSetting not bound -!missing-type! UNNotificationActionIcon not bound diff --git a/tests/xtro-sharpie/iOS-UserNotifications.todo b/tests/xtro-sharpie/iOS-UserNotifications.todo deleted file mode 100644 index 745467979741..000000000000 --- a/tests/xtro-sharpie/iOS-UserNotifications.todo +++ /dev/null @@ -1,27 +0,0 @@ -!missing-enum! UNNotificationInterruptionLevel not bound -!missing-enum-value! UNAuthorizationOptions native value UNAuthorizationOptionTimeSensitive = 256 not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeContentProvidingInvalid = 1501 not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeContentProvidingObjectNotAllowed = 1500 not bound -!missing-protocol! UNNotificationContentProviding not bound -!missing-selector! +UNNotificationAction::actionWithIdentifier:title:options:icon: not bound -!missing-selector! +UNNotificationActionIcon::iconWithSystemImageName: not bound -!missing-selector! +UNNotificationActionIcon::iconWithTemplateImageName: not bound -!missing-selector! +UNTextInputNotificationAction::actionWithIdentifier:title:options:icon:textInputButtonTitle:textInputPlaceholder: not bound -!missing-selector! UNMutableNotificationContent::interruptionLevel not bound -!missing-selector! UNMutableNotificationContent::relevanceScore not bound -!missing-selector! UNMutableNotificationContent::setInterruptionLevel: not bound -!missing-selector! UNMutableNotificationContent::setRelevanceScore: not bound -!missing-selector! UNNotificationAction::icon not bound -!missing-selector! UNNotificationContent::contentByUpdatingWithProvider:error: not bound -!missing-selector! UNNotificationContent::interruptionLevel not bound -!missing-selector! UNNotificationContent::relevanceScore not bound -!missing-selector! UNNotificationSettings::scheduledDeliverySetting not bound -!missing-selector! UNNotificationSettings::timeSensitiveSetting not bound -!missing-type! UNNotificationActionIcon not bound -!deprecated-attribute-missing! UNMutableNotificationContent::setSummaryArgument: missing a [Deprecated] attribute -!deprecated-attribute-missing! UNMutableNotificationContent::setSummaryArgumentCount: missing a [Deprecated] attribute -!deprecated-attribute-missing! UNMutableNotificationContent::summaryArgument missing a [Deprecated] attribute -!deprecated-attribute-missing! UNMutableNotificationContent::summaryArgumentCount missing a [Deprecated] attribute -!deprecated-attribute-missing! UNNotificationContent::summaryArgument missing a [Deprecated] attribute -!deprecated-attribute-missing! UNNotificationContent::summaryArgumentCount missing a [Deprecated] attribute -!missing-selector! UNNotificationSettings::directMessagesSetting not bound diff --git a/tests/xtro-sharpie/macOS-UserNotifications.todo b/tests/xtro-sharpie/macOS-UserNotifications.todo deleted file mode 100644 index 0a588f906349..000000000000 --- a/tests/xtro-sharpie/macOS-UserNotifications.todo +++ /dev/null @@ -1,21 +0,0 @@ -!missing-enum! UNNotificationInterruptionLevel not bound -!missing-enum-value! UNAuthorizationOptions native value UNAuthorizationOptionTimeSensitive = 256 not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeContentProvidingInvalid = 1501 not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeContentProvidingObjectNotAllowed = 1500 not bound -!missing-protocol! UNNotificationContentProviding not bound -!missing-selector! +UNNotificationAction::actionWithIdentifier:title:options:icon: not bound -!missing-selector! +UNNotificationActionIcon::iconWithSystemImageName: not bound -!missing-selector! +UNNotificationActionIcon::iconWithTemplateImageName: not bound -!missing-selector! +UNTextInputNotificationAction::actionWithIdentifier:title:options:icon:textInputButtonTitle:textInputPlaceholder: not bound -!missing-selector! UNMutableNotificationContent::interruptionLevel not bound -!missing-selector! UNMutableNotificationContent::relevanceScore not bound -!missing-selector! UNMutableNotificationContent::setInterruptionLevel: not bound -!missing-selector! UNMutableNotificationContent::setRelevanceScore: not bound -!missing-selector! UNNotificationAction::icon not bound -!missing-selector! UNNotificationContent::contentByUpdatingWithProvider:error: not bound -!missing-selector! UNNotificationContent::interruptionLevel not bound -!missing-selector! UNNotificationContent::relevanceScore not bound -!missing-selector! UNNotificationSettings::scheduledDeliverySetting not bound -!missing-selector! UNNotificationSettings::timeSensitiveSetting not bound -!missing-type! UNNotificationActionIcon not bound -!missing-selector! UNNotificationSettings::directMessagesSetting not bound diff --git a/tests/xtro-sharpie/tvOS-UserNotifications.ignore b/tests/xtro-sharpie/tvOS-UserNotifications.ignore new file mode 100644 index 000000000000..2d9fae697322 --- /dev/null +++ b/tests/xtro-sharpie/tvOS-UserNotifications.ignore @@ -0,0 +1,7 @@ +# both added and deprecated in Xcode 13 beta 2 +!missing-selector! UNMutableNotificationContent::setSummaryArgument: not bound +!missing-selector! UNMutableNotificationContent::setSummaryArgumentCount: not bound +!missing-selector! UNMutableNotificationContent::summaryArgument not bound +!missing-selector! UNMutableNotificationContent::summaryArgumentCount not bound +!missing-selector! UNNotificationContent::summaryArgument not bound +!missing-selector! UNNotificationContent::summaryArgumentCount not bound diff --git a/tests/xtro-sharpie/tvOS-UserNotifications.todo b/tests/xtro-sharpie/tvOS-UserNotifications.todo deleted file mode 100644 index 3019882f4979..000000000000 --- a/tests/xtro-sharpie/tvOS-UserNotifications.todo +++ /dev/null @@ -1,21 +0,0 @@ -!missing-enum! UNNotificationInterruptionLevel not bound -!missing-enum-value! UNAuthorizationOptions native value UNAuthorizationOptionTimeSensitive = 256 not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeContentProvidingInvalid = 1501 not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeContentProvidingObjectNotAllowed = 1500 not bound -!missing-protocol! UNNotificationContentProviding not bound -!missing-selector! +UNNotificationActionIcon::iconWithSystemImageName: not bound -!missing-selector! +UNNotificationActionIcon::iconWithTemplateImageName: not bound -!missing-selector! UNMutableNotificationContent::interruptionLevel not bound -!missing-selector! UNMutableNotificationContent::relevanceScore not bound -!missing-selector! UNMutableNotificationContent::setInterruptionLevel: not bound -!missing-selector! UNMutableNotificationContent::setRelevanceScore: not bound -!missing-selector! UNNotificationContent::contentByUpdatingWithProvider:error: not bound -!missing-selector! UNNotificationContent::interruptionLevel not bound -!missing-selector! UNNotificationContent::relevanceScore not bound -!missing-type! UNNotificationActionIcon not bound -!missing-selector! UNMutableNotificationContent::setSummaryArgument: not bound -!missing-selector! UNMutableNotificationContent::setSummaryArgumentCount: not bound -!missing-selector! UNMutableNotificationContent::summaryArgument not bound -!missing-selector! UNMutableNotificationContent::summaryArgumentCount not bound -!missing-selector! UNNotificationContent::summaryArgument not bound -!missing-selector! UNNotificationContent::summaryArgumentCount not bound diff --git a/tests/xtro-sharpie/watchOS-UserNotifications.ignore b/tests/xtro-sharpie/watchOS-UserNotifications.ignore new file mode 100644 index 000000000000..2d9fae697322 --- /dev/null +++ b/tests/xtro-sharpie/watchOS-UserNotifications.ignore @@ -0,0 +1,7 @@ +# both added and deprecated in Xcode 13 beta 2 +!missing-selector! UNMutableNotificationContent::setSummaryArgument: not bound +!missing-selector! UNMutableNotificationContent::setSummaryArgumentCount: not bound +!missing-selector! UNMutableNotificationContent::summaryArgument not bound +!missing-selector! UNMutableNotificationContent::summaryArgumentCount not bound +!missing-selector! UNNotificationContent::summaryArgument not bound +!missing-selector! UNNotificationContent::summaryArgumentCount not bound diff --git a/tests/xtro-sharpie/watchOS-UserNotifications.todo b/tests/xtro-sharpie/watchOS-UserNotifications.todo deleted file mode 100644 index 89b25ab0c03a..000000000000 --- a/tests/xtro-sharpie/watchOS-UserNotifications.todo +++ /dev/null @@ -1,28 +0,0 @@ -!missing-enum! UNNotificationInterruptionLevel not bound -!missing-enum-value! UNAuthorizationOptions native value UNAuthorizationOptionTimeSensitive = 256 not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeContentProvidingInvalid = 1501 not bound -!missing-enum-value! UNErrorCode native value UNErrorCodeContentProvidingObjectNotAllowed = 1500 not bound -!missing-protocol! UNNotificationContentProviding not bound -!missing-selector! +UNLocationNotificationTrigger::triggerWithRegion:repeats: not bound -!missing-selector! +UNNotificationAction::actionWithIdentifier:title:options:icon: not bound -!missing-selector! +UNNotificationActionIcon::iconWithSystemImageName: not bound -!missing-selector! +UNNotificationActionIcon::iconWithTemplateImageName: not bound -!missing-selector! +UNTextInputNotificationAction::actionWithIdentifier:title:options:icon:textInputButtonTitle:textInputPlaceholder: not bound -!missing-selector! UNMutableNotificationContent::interruptionLevel not bound -!missing-selector! UNMutableNotificationContent::relevanceScore not bound -!missing-selector! UNMutableNotificationContent::setInterruptionLevel: not bound -!missing-selector! UNMutableNotificationContent::setRelevanceScore: not bound -!missing-selector! UNNotificationAction::icon not bound -!missing-selector! UNNotificationContent::contentByUpdatingWithProvider:error: not bound -!missing-selector! UNNotificationContent::interruptionLevel not bound -!missing-selector! UNNotificationContent::relevanceScore not bound -!missing-selector! UNNotificationSettings::scheduledDeliverySetting not bound -!missing-selector! UNNotificationSettings::timeSensitiveSetting not bound -!missing-type! UNNotificationActionIcon not bound -!missing-selector! UNMutableNotificationContent::setSummaryArgument: not bound -!missing-selector! UNMutableNotificationContent::setSummaryArgumentCount: not bound -!missing-selector! UNMutableNotificationContent::summaryArgument not bound -!missing-selector! UNMutableNotificationContent::summaryArgumentCount not bound -!missing-selector! UNNotificationContent::summaryArgument not bound -!missing-selector! UNNotificationContent::summaryArgumentCount not bound -!missing-selector! UNNotificationSettings::directMessagesSetting not bound