Skip to content

[StoreKit] Fix all availability attributes in this framework. #22690

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 1 commit into from
Apr 30, 2025
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
4 changes: 0 additions & 4 deletions src/StoreKit/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ public enum SKError : long {
// iOS 10.3
/// <summary>To be added.</summary>
CloudServiceRevoked,
#if !NET
[Obsolete ("Use 'SKError.CloudServiceRevoked' instead.")]
Revoked = CloudServiceRevoked,
#endif
// iOS 12.2
/// <summary>To be added.</summary>
PrivacyAcknowledgementRequired,
Expand Down
2 changes: 0 additions & 2 deletions src/StoreKit/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
namespace StoreKit {

partial class SKReceiptRefreshRequest {
#if NET
/// <summary>To be added.</summary>
/// <remarks>To be added.</remarks>
[SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")]
#endif
[DllImport (Constants.StoreKitLibrary, EntryPoint = "SKTerminateForInvalidReceipt")]
static extern public void TerminateForInvalidReceipt ();
}
Expand Down
41 changes: 0 additions & 41 deletions src/StoreKit/SKAdNetworkCompat.cs

This file was deleted.

8 changes: 8 additions & 0 deletions src/StoreKit/SKReceiptProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
namespace StoreKit {
/// <summary>Defines test properties for the <format type="text/html"><a href="https://docs.microsoft.com/en-us/search/index?search=C:StoreKit.SKReceiptRefreshRequest(Foundation.NSDictionary)&amp;scope=Xamarin" title="C:StoreKit.SKReceiptRefreshRequest(Foundation.NSDictionary)">C:StoreKit.SKReceiptRefreshRequest(Foundation.NSDictionary)</a></format> constructor.</summary>
/// <remarks>To be added.</remarks>
[SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
[ObsoletedOSPlatform ("ios18.0")]
[ObsoletedOSPlatform ("maccatalyst18.0")]
[ObsoletedOSPlatform ("macos15.0")]
[ObsoletedOSPlatform ("tvos18.0")]
public partial class SKReceiptProperties : DictionaryContainer {
#if !COREBUILD
/// <summary>To be added.</summary>
Expand Down
1 change: 0 additions & 1 deletion src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,6 @@ STOREKIT_CORE_SOURCES = \

STOREKIT_SOURCES = \
StoreKit/NativeMethods.cs \
StoreKit/SKAdNetworkCompat.cs \
StoreKit/SKCloudServiceSetupOptions.cs \
StoreKit/SKPayment.cs \
StoreKit/SwiftAPI.cs \
Expand Down
35 changes: 0 additions & 35 deletions src/storekit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
#endif
using System;

#if !NET
using NativeHandle = System.IntPtr;
#endif

#nullable enable

namespace StoreKit {
Expand Down Expand Up @@ -167,9 +163,7 @@ partial interface SKDownload {
[Deprecated (PlatformName.TvOS, 18, 0 /* Apple's replacement requires Swift */ )]
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
#if NET
[DisableDefaultCtor]
#endif
partial interface SKPayment : NSMutableCopying {
[Static]
[Export ("paymentWithProduct:")]
Expand Down Expand Up @@ -214,9 +208,7 @@ partial interface SKPayment : NSMutableCopying {
[Deprecated (PlatformName.TvOS, 18, 0 /* Apple's replacement requires Swift */ )]
[MacCatalyst (13, 1)]
[BaseType (typeof (SKPayment))]
#if NET
[DisableDefaultCtor]
#endif
interface SKMutablePayment {
[Static]
[Export ("paymentWithProduct:")]
Expand Down Expand Up @@ -388,25 +380,14 @@ interface SKProduct {
[Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'IsDownloadable' instead.")]
[Export ("downloadable")]
bool Downloadable { get; }
#elif !NET
[NoMac]
[Obsolete ("Use 'IsDownloadable' instead.")]
bool Downloadable {
[Wrap ("IsDownloadable")]
get;
}
#endif

[MacCatalyst (13, 1)]
[Export ("isDownloadable")]
bool IsDownloadable { get; }

[NoiOS]
#if NET
[NoTV]
#else
[Deprecated (PlatformName.TvOS, 9, 0, message: "Use 'DownloadContentLengths' instead.")]
#endif
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'DownloadContentLengths' instead.")]
[NoMacCatalyst]
[Export ("contentLengths")]
Expand Down Expand Up @@ -765,13 +746,6 @@ interface SKProductsRequestDelegate {
Delegates = new string [] { "WeakDelegate" },
Events = new Type [] { typeof (SKStoreProductViewControllerDelegate) })]
interface SKStoreProductViewController {
#if !NET
// SKStoreProductViewController is an OS View Controller which can't be customized
[Export ("initWithNibName:bundle:")]
[PostGet ("NibBundle")]
NativeHandle Constructor ([NullAllowed] string nibName, [NullAllowed] NSBundle bundle);
#endif

[Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
NSObject WeakDelegate { get; set; }

Expand Down Expand Up @@ -1533,12 +1507,7 @@ interface ISKPaymentQueueDelegate { }
[Deprecated (PlatformName.TvOS, 18, 0 /* Apple's replacement requires Swift */ )]
[iOS (13, 0)]
[MacCatalyst (13, 1)]
#if NET
[Protocol, Model]
#else
[Protocol]
[Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface SKPaymentQueueDelegate {
[Export ("paymentQueue:shouldContinueTransaction:inStorefront:")]
Expand Down Expand Up @@ -1695,11 +1664,7 @@ interface ISKOverlayDelegate { }

[NoTV, NoMac, iOS (14, 0)]
[MacCatalyst (14, 0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface SKOverlayDelegate {
[Export ("storeOverlay:didFailToLoadWithError:")]
Expand Down
3 changes: 0 additions & 3 deletions tests/cecil-tests/ApiAvailabilityTest.KnownFailures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ public partial class ApiAvailabilityTest {
"/src/Foundation/NSUrlSessionHandler.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'SslProtocol.Tls_1_2' is obsoleted on: 'ios' 13.0 and later (Use 'TlsProtocolVersion' instead.), 'maccatalyst' 13.0 and later (Use 'TlsProtocolVersion' instead.), 'macOS/OSX' 10.15 and later (Use 'TlsProtocolVersion' instead.), 'tvos' 13.0 and later (Use 'TlsProtocolVersion' instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)",
"/src/Foundation/NSUrlSessionHandler.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'SslProtocol.Tls_1_3' is obsoleted on: 'ios' 13.0 and later (Use 'TlsProtocolVersion' instead.), 'maccatalyst' 13.0 and later (Use 'TlsProtocolVersion' instead.), 'macOS/OSX' 10.15 and later (Use 'TlsProtocolVersion' instead.), 'tvos' 13.0 and later (Use 'TlsProtocolVersion' instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)",
"/src/GameController/GCExtendedGamepadSnapshot.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'GCExtendedGamepadSnapShotDataV100' is obsoleted on: 'ios' 12.2 and later (Use 'GCExtendedGamepadSnapshotData' instead.), 'maccatalyst' 12.2 and later (Use 'GCExtendedGamepadSnapshotData' instead.), 'macOS/OSX' 10.14.4 and later (Use 'GCExtendedGamepadSnapshotData' instead.), 'tvos' 12.2 and later (Use 'GCExtendedGamepadSnapshotData' instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)",
"/src/StoreKit/SKReceiptProperty.cs has 8 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. '_SKReceiptProperty.IsExpired' is obsoleted on: 'ios' 18.0 and later, 'maccatalyst' 18.0 and later, 'macOS/OSX' 15.0 and later, 'tvos' 18.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)",
"/src/StoreKit/SKReceiptProperty.cs has 8 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. '_SKReceiptProperty.IsRevoked' is obsoleted on: 'ios' 18.0 and later, 'maccatalyst' 18.0 and later, 'macOS/OSX' 15.0 and later, 'tvos' 18.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)",
"/src/StoreKit/SKReceiptProperty.cs has 8 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. '_SKReceiptProperty.IsVolumePurchase' is obsoleted on: 'ios' 18.0 and later, 'maccatalyst' 18.0 and later, 'macOS/OSX' 15.0 and later, 'tvos' 18.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)",
"/src/System.Net.Http/CFNetworkHandler.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CFHTTPStream.GetResponseHeader()' is obsoleted on: 'ios' 9.0 and later (Use 'NSUrlSession'.), 'maccatalyst' 9.0 and later (Use 'NSUrlSession'.), 'macOS/OSX' 10.11 and later (Use 'NSUrlSession'.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)",
"/src/System.Net.Http/CFNetworkHandler.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CFHTTPStream.SetProxy(CFProxySettings)' is obsoleted on: 'ios' 9.0 and later (Use 'NSUrlSession'.), 'maccatalyst' 9.0 and later (Use 'NSUrlSession'.), 'macOS/OSX' 10.11 and later (Use 'NSUrlSession'.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)",
"/src/System.Net.Http/CFNetworkHandler.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CFHTTPStream.ShouldAutoredirect' is obsoleted on: 'ios' 9.0 and later (Use 'NSUrlSession'.), 'maccatalyst' 9.0 and later (Use 'NSUrlSession'.), 'macOS/OSX' 10.11 and later (Use 'NSUrlSession'.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)",
Expand Down
2 changes: 1 addition & 1 deletion tests/cecil-tests/ApiAvailabilityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void Warnings ()
} finally {
Console.WriteLine ($"There's a total of {totalWarnings} warnings.");
}
Assert.AreEqual (351, totalWarnings, "Total warnings"); // this is just to see how the warning count changes as issues are fixed.
Assert.AreEqual (327, totalWarnings, "Total warnings"); // this is just to see how the warning count changes as issues are fixed.
}

public record ObsoletedFailure : IComparable {
Expand Down
Loading