Skip to content

[SafariServices] Implement Xcode 16.2 beta 1-3 changes. #21721

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

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion src/safariservices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

using System;

#if HAS_BROWSERENGINEKIT
using BrowserEngineKit;
#else
using BEWebAppManifest = Foundation.NSObject;
#endif
using Foundation;
using ObjCRuntime;
#if !MONOMAC
Expand Down Expand Up @@ -542,7 +547,7 @@ interface SFExtension {
[Field ("SFExtensionMessageKey")]
NSString MessageKey { get; }

[iOS (17, 0), Mac (14, 0), NoMacCatalyst]
[iOS (17, 0), Mac (14, 0), MacCatalyst (17, 1)]
[Field ("SFExtensionProfileKey")]
NSString ProfileKey { get; }
}
Expand Down Expand Up @@ -584,6 +589,9 @@ interface SFSafariViewControllerDataStore {
void ClearWebsiteData ([NullAllowed] Action completion);
}

delegate void SFAddToHomeScreenActivityItemGetWebAppManifestCallback ([NullAllowed] BEWebAppManifest appManifest);
delegate void SFAddToHomeScreenActivityItemGetHomeScreenWebAppInfoCallback ([NullAllowed] SFAddToHomeScreenInfo appManifest);

[iOS (17, 4), MacCatalyst (17, 4), NoMac, NoTV, NoWatch]
[Protocol (BackwardsCompatibleCodeGeneration = false)]
interface SFAddToHomeScreenActivityItem {
Expand All @@ -598,6 +606,32 @@ interface SFAddToHomeScreenActivityItem {

[NullAllowed, Export ("iconItemProvider")]
NSItemProvider IconItemProvider { get; }

[NoMacCatalyst] // The BrowserEngineKit framework (the BEWebAppManifest type) isn't available on Mac Catalyst.
[Deprecated (PlatformName.iOS, 18, 2, "Use 'GetHomeScreenWebAppInfo' instead.")]
[Async]
[Export ("getWebAppManifestWithCompletionHandler:")]
void GetWebAppManifest (SFAddToHomeScreenActivityItemGetWebAppManifestCallback completionHandler);

[iOS (18, 2), NoMacCatalyst]
[Async]
[Export ("getHomeScreenWebAppInfoWithCompletionHandler:")]
void GetHomeScreenWebAppInfo (SFAddToHomeScreenActivityItemGetHomeScreenWebAppInfoCallback completionHandler);
}

[iOS (18, 2), NoMacCatalyst, NoMac]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SFAddToHomeScreenInfo : NSCopying {
[NoMacCatalyst] // The BrowserEngineKit framework (the BEWebAppManifest type) isn't available on Mac Catalyst.
[Export ("initWithManifest:")]
[DesignatedInitializer]
NativeHandle Constructor (BEWebAppManifest manifest);

[Export ("manifest", ArgumentSemantic.Copy)]
BEWebAppManifest Manifest { get; }

[Export ("websiteCookies", ArgumentSemantic.Copy)]
NSHttpCookie [] WebsiteCookies { get; set; }
}
}
11 changes: 11 additions & 0 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42528,6 +42528,10 @@ M:ReplayKit.RPScreenRecorderDelegate_Extensions.DidStopRecording(ReplayKit.IRPSc
M:ReplayKit.RPSystemBroadcastPickerView.#ctor(CoreGraphics.CGRect)
M:ReplayKit.RPSystemBroadcastPickerView.EncodeTo(Foundation.NSCoder)
M:ReplayKit.RPSystemBroadcastPickerView.RPSystemBroadcastPickerViewAppearance.#ctor(System.IntPtr)
M:SafariServices.ISFAddToHomeScreenActivityItem.GetHomeScreenWebAppInfo(SafariServices.SFAddToHomeScreenActivityItemGetHomeScreenWebAppInfoCallback)
M:SafariServices.ISFAddToHomeScreenActivityItem.GetHomeScreenWebAppInfoAsync
M:SafariServices.ISFAddToHomeScreenActivityItem.GetWebAppManifest(SafariServices.SFAddToHomeScreenActivityItemGetWebAppManifestCallback)
M:SafariServices.ISFAddToHomeScreenActivityItem.GetWebAppManifestAsync
M:SafariServices.ISFSafariExtensionHandling.AdditionalRequestHeaders(Foundation.NSUrl,System.Action{Foundation.NSDictionary{Foundation.NSString,Foundation.NSString}})
M:SafariServices.ISFSafariExtensionHandling.ContentBlocker(System.String,Foundation.NSUrl[],SafariServices.SFSafariPage)
M:SafariServices.ISFSafariExtensionHandling.ContextMenuItemSelected(System.String,SafariServices.SFSafariPage,Foundation.NSDictionary)
Expand All @@ -42547,6 +42551,8 @@ M:SafariServices.ISFSafariViewControllerDelegate.GetActivityItems(SafariServices
M:SafariServices.ISFSafariViewControllerDelegate.GetExcludedActivityTypes(SafariServices.SFSafariViewController,Foundation.NSUrl,System.String)
M:SafariServices.ISFSafariViewControllerDelegate.InitialLoadDidRedirectToUrl(SafariServices.SFSafariViewController,Foundation.NSUrl)
M:SafariServices.ISFSafariViewControllerDelegate.WillOpenInBrowser(SafariServices.SFSafariViewController)
M:SafariServices.SFAddToHomeScreenInfo.#ctor(BrowserEngineKit.BEWebAppManifest)
M:SafariServices.SFAddToHomeScreenInfo.Copy(Foundation.NSZone)
M:SafariServices.SFAuthenticationSession.#ctor(Foundation.NSUrl,System.String,SafariServices.SFAuthenticationCompletionHandler)
M:SafariServices.SFAuthenticationSession.Cancel
M:SafariServices.SFAuthenticationSession.Start
Expand Down Expand Up @@ -66563,6 +66569,8 @@ P:SafariServices.ISFAddToHomeScreenActivityItem.IconItemProvider
P:SafariServices.ISFAddToHomeScreenActivityItem.Title
P:SafariServices.ISFAddToHomeScreenActivityItem.Url
P:SafariServices.ISFSafariExtensionHandling.PopoverViewController
P:SafariServices.SFAddToHomeScreenInfo.Manifest
P:SafariServices.SFAddToHomeScreenInfo.WebsiteCookies
P:SafariServices.SFContentBlockerState.Enabled
P:SafariServices.SFExtension.MessageKey
P:SafariServices.SFExtension.ProfileKey
Expand Down Expand Up @@ -75366,6 +75374,9 @@ T:ReplayKit.RPRecordingError
T:ReplayKit.RPSampleBufferType
T:SafariServices.ISFAddToHomeScreenActivityItem
T:SafariServices.ISFSafariExtensionHandling
T:SafariServices.SFAddToHomeScreenActivityItemGetHomeScreenWebAppInfoCallback
T:SafariServices.SFAddToHomeScreenActivityItemGetWebAppManifestCallback
T:SafariServices.SFAddToHomeScreenInfo
T:SafariServices.SFAuthenticationError
T:SafariServices.SFContentBlockerErrorCode
T:SafariServices.SFExtension
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
## for compatibility we have extra code that return `false` if `url` is `null`
!extra-null-allowed! 'System.Boolean SafariServices.SSReadingList::SupportsUrl(Foundation.NSUrl)' has a extraneous [NullAllowed] on parameter #0

## this member references a framework which isn't available on Mac Catalyst
!missing-protocol-member! SFAddToHomeScreenActivityItem::getWebAppManifestWithCompletionHandler: not found

This file was deleted.

This file was deleted.