Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UserNotifications] Updates for Xcode13 beta 3 #12130

Merged
merged 13 commits into from
Jul 23, 2021
127 changes: 125 additions & 2 deletions src/usernotifications.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public enum UNErrorCode : long {
AttachmentMoveIntoDataStoreFailed,
AttachmentCorrupt,
NotificationInvalidNoDate = 1400,
NotificationInvalidNoContent
NotificationInvalidNoContent,
ContentProvidingObjectNotAllowed = 1500,
ContentProvidingInvalid = 1501,
}

[iOS (10, 0)]
Expand Down Expand Up @@ -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)]
Expand Down Expand Up @@ -163,6 +167,43 @@ 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,
}


tj-devel709 marked this conversation as resolved.
Show resolved Hide resolved
[MacCatalyst (15,0), NoiOS, NoMac, NoWatch, NoTV]
enum UNNotificationInterruptionReason {
[Field ("UNNotificationInterruptionReasonAccountSecurity")]
AccountSecurity,
[Field ("UNNotificationInterruptionReasonHealthAndWellness")]
HealthAndWellness,
[Field ("UNNotificationInterruptionReasonLocalSafety")]
LocalSafety,
[Field ("UNNotificationInterruptionReasonHomeSecurity")]
HomeSecurity,
[Field ("UNNotificationInterruptionReasonOrderPickup")]
OrderPickup,
[Field ("UNNotificationInterruptionReasonPackageDelivery")]
PackageDelivery,
[Field ("UNNotificationInterruptionReasonTransportationDeparting")]
TransportationDeparting,
[Field ("UNNotificationInterruptionReasonSchedule")]
Schedule,
[Field ("UNNotificationInterruptionReasonTimeExpired")]
TimeExpired,
[Field ("UNNotificationInterruptionReasonApprovalRequest")]
ApprovalRequest,
[Field ("UNNotificationInterruptionReasonUrgentMessage")]
UrgentMessage,
tj-devel709 marked this conversation as resolved.
Show resolved Hide resolved
}

[iOS (10, 0)]
[TV (10, 0)]
[Watch (3, 0)]
Expand Down Expand Up @@ -198,6 +239,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)]
Expand All @@ -212,6 +262,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; }

Expand Down Expand Up @@ -382,10 +437,12 @@ interface UNNotificationContent : NSCopying, NSMutableCopying, NSSecureCoding {
NSDictionary UserInfo { get; }

[NoWatch, NoTV, iOS (12, 0)]
[Deprecated (PlatformName.iOS, 15, 0, message: "The property 'summaryArgument' is ignored.")]
tj-devel709 marked this conversation as resolved.
Show resolved Hide resolved
[Export ("summaryArgument")]
string SummaryArgument { get; }

[NoWatch, NoTV, iOS (12, 0)]
[Deprecated (PlatformName.iOS, 15, 0, message: "The property 'summaryArgumentCount' is ignored.")]
tj-devel709 marked this conversation as resolved.
Show resolved Hide resolved
[Export ("summaryArgumentCount")]
nuint SummaryArgumentCount { get; }

Expand All @@ -394,6 +451,23 @@ 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 ContentByUpdatingWithProvider (IUNNotificationContentProviding provider, [NullAllowed] out NSError outError);
tj-devel709 marked this conversation as resolved.
Show resolved Hide resolved

[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("interruptionLevel", ArgumentSemantic.Assign)]
UNNotificationInterruptionLevel InterruptionLevel { get; }

[NoWatch, NoTV, NoMac, NoiOS, MacCatalyst (15,0)]
[Export ("interruptionReason")]
string InterruptionReason { get; }
tj-devel709 marked this conversation as resolved.
Show resolved Hide resolved

[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("relevanceScore")]
double RelevanceScore { get; }
}

[iOS (10, 0)]
Expand Down Expand Up @@ -442,10 +516,12 @@ interface UNMutableNotificationContent {
NSDictionary UserInfo { get; set; }

[NoWatch, NoTV, iOS (12, 0)]
[Deprecated (PlatformName.iOS, 15, 0, message: "The property 'summaryArgument' is ignored.")]
tj-devel709 marked this conversation as resolved.
Show resolved Hide resolved
[Export ("summaryArgument")]
string SummaryArgument { get; set; }

[NoWatch, NoTV, iOS (12, 0)]
[Deprecated (PlatformName.iOS, 15, 0, message: "The property 'summaryArgumentCount' is ignored.")]
tj-devel709 marked this conversation as resolved.
Show resolved Hide resolved
[Export ("summaryArgumentCount")]
nuint SummaryArgumentCount { get; set; }

Expand All @@ -454,6 +530,19 @@ 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; }

[NoWatch, NoTV, NoMac, NoiOS, MacCatalyst (15,0)]
[BindAs (typeof (UNNotificationInterruptionReason))]
[Export ("interruptionReason")]
NSString InterruptionReason { get; set; }
tj-devel709 marked this conversation as resolved.
Show resolved Hide resolved
}

[iOS (10, 0)]
Expand Down Expand Up @@ -605,6 +694,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)]
[Export ("timeSensitiveSetting")]
UNNotificationSetting TimeSensitiveSetting { get; }

[iOS (15,0), Mac (12,0), MacCatalyst (15,0), Watch (8,0)]
[Export ("scheduledDeliverySetting")]
UNNotificationSetting ScheduledDeliverySetting { get; }

[iOS (15,0), Mac (12,0), MacCatalyst (15,0), Watch (8,0)]
[Export ("directMessagesSetting")]
UNNotificationSetting DirectMessagesSetting { get; }
}

[iOS (10, 0)]
Expand Down Expand Up @@ -717,7 +818,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);
Expand Down Expand Up @@ -807,5 +908,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);
spouliot marked this conversation as resolved.
Show resolved Hide resolved

[Static]
[Export ("iconWithSystemImageName:")]
UNNotificationActionIcon CreateFromSystem (string ImageName);
spouliot marked this conversation as resolved.
Show resolved Hide resolved
}

interface IUNNotificationContentProviding {}

[iOS (15,0), Mac (12,0), MacCatalyst (15,0), TV (15,0), Watch (8,0)]
[Protocol]
interface UNNotificationContentProviding
{
}
}

35 changes: 0 additions & 35 deletions tests/xtro-sharpie/MacCatalyst-UserNotifications.todo

This file was deleted.

27 changes: 0 additions & 27 deletions tests/xtro-sharpie/iOS-UserNotifications.todo

This file was deleted.

21 changes: 0 additions & 21 deletions tests/xtro-sharpie/macOS-UserNotifications.todo

This file was deleted.

7 changes: 7 additions & 0 deletions tests/xtro-sharpie/tvOS-UserNotifications.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Deprecated
!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
spouliot marked this conversation as resolved.
Show resolved Hide resolved
21 changes: 0 additions & 21 deletions tests/xtro-sharpie/tvOS-UserNotifications.todo

This file was deleted.

7 changes: 7 additions & 0 deletions tests/xtro-sharpie/watchOS-UserNotifications.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Deprecated
!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
spouliot marked this conversation as resolved.
Show resolved Hide resolved
28 changes: 0 additions & 28 deletions tests/xtro-sharpie/watchOS-UserNotifications.todo

This file was deleted.