StoreKit2Bindings.ShowManageSubscriptions 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package StoreKit2Bindings.ShowManageSubscriptions --version 1.0.0                
NuGet\Install-Package StoreKit2Bindings.ShowManageSubscriptions -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="StoreKit2Bindings.ShowManageSubscriptions" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StoreKit2Bindings.ShowManageSubscriptions --version 1.0.0                
#r "nuget: StoreKit2Bindings.ShowManageSubscriptions, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install StoreKit2Bindings.ShowManageSubscriptions as a Cake Addin
#addin nuget:?package=StoreKit2Bindings.ShowManageSubscriptions&version=1.0.0

// Install StoreKit2Bindings.ShowManageSubscriptions as a Cake Tool
#tool nuget:?package=StoreKit2Bindings.ShowManageSubscriptions&version=1.0.0                

Xamarin.iOS.StoreKit2Sample

This is a sample how to leverage StoreKit2 in Xamarin.iOS. Extend to your needs.

Add required methods in StoreKit2/StoreKit2/AppStoreManager.Swift

The methods need to be objc compatibile (@objc), class has to derive from NSObject so it can be consumed from objc. I just added showManageSubscriptions because this is the only method I needed in my project.

Build release in xcode for Debug and Release.

Create xcframework so it works on both iPhone and simulator.

xcodebuild -create-xcframework -framework path-from-your-xcode-derived-path/Release-iphoneos/StoreKit2.framework -framework Release-path-from-your-xcode-derived-path//StoreKit2.framework -output ./StoreKit2.xcframework

Download latest objective sharpie pkg

https://github.com/xamarin/xamarin-macios/blob/main/Make.config#L234C1-L235C1

Generate ApiDefinitions / enums

sharpie bind ..../Release-iphoneos/StoreKit2.framework/Headers/StoreKit2-Swift.h --sdk iphoneos16.2

Copy this to Xamarin bindings project (see sample attached)

Generate and consume nuget package

Take a look at .nuspec and .target file. This is required so .xcframework is properly included in your iOS project.

Notes

There is Xamarin iOS bug that prevents async swift methods working on simulator. It works on real device though which is enough for StoreKit. https://github.com/xamarin/xamarin-macios/issues/18562

Product Compatible and additional computed target framework versions.
Xamarin.iOS xamarinios10 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 183 9/29/2023
1.0.0 171 7/31/2023