Skip to content

Commit

Permalink
[UserNotifications] Updates for Xcode13 beta 3 (#12130)
Browse files Browse the repository at this point in the history
  • Loading branch information
tj-devel709 authored Jul 23, 2021
1 parent 6c06a9f commit a27a58a
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 120 deletions.
91 changes: 89 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,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)]
Expand Down Expand Up @@ -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)]
Expand All @@ -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; }

Expand Down Expand Up @@ -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; }

Expand All @@ -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)]
Expand Down Expand Up @@ -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; }

Expand All @@ -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)]
Expand Down Expand Up @@ -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)]
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
{
}
}

21 changes: 0 additions & 21 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 @@
# 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
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 @@
# 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
28 changes: 0 additions & 28 deletions tests/xtro-sharpie/watchOS-UserNotifications.todo

This file was deleted.

7 comments on commit a27a58a

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ [CI Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

Packages generated

View packages

Test results

2 tests failed, 222 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Debug [dotnet]: Failed (Tests run: 2629 Passed: 2486 Inconclusive: 35 Failed: 2 Ignored: 141)
  • Documentation/All: Failed

Pipeline on Agent XAMBOT-1027.BigSur'
[UserNotifications] Updates for Xcode13 beta 3 (#12130)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Tests failed catastrophically on VSTS: device tests tvOS 🔥

Not enough free space in the host.

Pipeline on Agent
[UserNotifications] Updates for Xcode13 beta 3 (#12130)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Tests were not ran (VSTS: device tests iOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[UserNotifications] Updates for Xcode13 beta 3 (#12130)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Tests were not ran (VSTS: device tests tvOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[UserNotifications] Updates for Xcode13 beta 3 (#12130)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Tests passed on macOS Mac Catalina (10.15) ✅

Tests passed

All tests on macOS X Mac Catalina (10.15) passed.

Pipeline on Agent
[UserNotifications] Updates for Xcode13 beta 3 (#12130)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Tests passed on macOS Mac Mojave (10.14) ✅

Tests passed

All tests on macOS X Mac Mojave (10.14) passed.

Pipeline on Agent
[UserNotifications] Updates for Xcode13 beta 3 (#12130)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Tests passed on macOS Mac High Sierra (10.13) ✅

Tests passed

All tests on macOS X Mac High Sierra (10.13) passed.

Pipeline on Agent
[UserNotifications] Updates for Xcode13 beta 3 (#12130)

Please sign in to comment.