Skip to content

Commit e5ae7df

Browse files
committed
Added begin refund request method from StoreKit2
1 parent bcec94c commit e5ae7df

38 files changed

Lines changed: 903 additions & 217 deletions

.DS_Store

2 KB
Binary file not shown.

Bindings/.DS_Store

0 Bytes
Binary file not shown.

Bindings/ApiDefinition.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55

66
namespace StoreKit2Bindings
77
{
8-
9-
10-
// @interface StoreKitAppStore : NSObject
118
[BaseType (typeof(NSObject), Name = "_TtC9StoreKit216StoreKitAppStore")]
129
interface StoreKitAppStore
1310
{
@@ -17,4 +14,13 @@ interface StoreKitAppStore
1714
void ShowManageSubscriptionsIn (UIWindowScene scene, Action<NSError> completionHandler);
1815
}
1916

17+
[BaseType (typeof(NSObject), Name = "_TtC9StoreKit219StoreKitTransaction")]
18+
interface StoreKitTransaction
19+
{
20+
// +(void)beginRefundRequestFor:(uint64_t)transactionId in:(UIWindowScene * _Nonnull)scene completionHandler:(void (^ _Nonnull)(NSError * _Nullable))completionHandler;
21+
[Static]
22+
[Export ("beginRefundRequestFor:in:completionHandler:")]
23+
void BeginRefundRequestFor (ulong transactionId, UIWindowScene scene, Action<NSError> completionHandler);
24+
}
25+
2026
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Threading.Tasks;
2+
using Foundation;
3+
using UIKit;
4+
5+
namespace StoreKit2Bindings.Extensions;
6+
7+
public static class StoreKitTransactionExtensions
8+
{
9+
public static Task<NSError> BeginRefundRequestFor(ulong transactionId, UIWindowScene scene)
10+
{
11+
var tcs = new TaskCompletionSource<NSError>();
12+
13+
StoreKitTransaction.BeginRefundRequestFor(transactionId, scene, error =>
14+
{
15+
tcs.TrySetResult(error);
16+
});
17+
18+
return tcs.Task;
19+
}
20+
}
-6 KB
Binary file not shown.

Bindings/StoreKit2.xcframework/Info.plist

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@
66
<array>
77
<dict>
88
<key>LibraryIdentifier</key>
9-
<string>ios-arm64_x86_64-simulator</string>
9+
<string>ios-arm64</string>
1010
<key>LibraryPath</key>
1111
<string>StoreKit2.framework</string>
1212
<key>SupportedArchitectures</key>
1313
<array>
1414
<string>arm64</string>
15-
<string>x86_64</string>
1615
</array>
1716
<key>SupportedPlatform</key>
1817
<string>ios</string>
19-
<key>SupportedPlatformVariant</key>
20-
<string>simulator</string>
2118
</dict>
2219
<dict>
2320
<key>LibraryIdentifier</key>
24-
<string>ios-arm64</string>
21+
<string>ios-arm64_x86_64-simulator</string>
2522
<key>LibraryPath</key>
2623
<string>StoreKit2.framework</string>
2724
<key>SupportedArchitectures</key>
2825
<array>
2926
<string>arm64</string>
27+
<string>x86_64</string>
3028
</array>
3129
<key>SupportedPlatform</key>
3230
<string>ios</string>
31+
<key>SupportedPlatformVariant</key>
32+
<string>simulator</string>
3333
</dict>
3434
</array>
3535
<key>CFBundlePackageType</key>

Bindings/StoreKit2.xcframework/ios-arm64/StoreKit2.framework/Headers/StoreKit2-Swift.h

Lines changed: 94 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#if 0
22
#elif defined(__arm64__) && __arm64__
3-
// Generated by Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
3+
// Generated by Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100)
44
#ifndef STOREKIT2_SWIFT_H
55
#define STOREKIT2_SWIFT_H
66
#pragma clang diagnostic push
@@ -23,7 +23,6 @@
2323
# include <swift/objc-prologue.h>
2424
#endif
2525

26-
#pragma clang diagnostic ignored "-Wduplicate-method-match"
2726
#pragma clang diagnostic ignored "-Wauto-import"
2827
#if defined(__OBJC__)
2928
#include <Foundation/Foundation.h>
@@ -32,10 +31,24 @@
3231
#include <cstdint>
3332
#include <cstddef>
3433
#include <cstdbool>
34+
#include <cstring>
35+
#include <stdlib.h>
36+
#include <new>
37+
#include <type_traits>
3538
#else
3639
#include <stdint.h>
3740
#include <stddef.h>
3841
#include <stdbool.h>
42+
#include <string.h>
43+
#endif
44+
#if defined(__cplusplus)
45+
#if __has_include(<ptrauth.h>)
46+
# include <ptrauth.h>
47+
#else
48+
# ifndef __ptrauth_swift_value_witness_function_pointer
49+
# define __ptrauth_swift_value_witness_function_pointer(x)
50+
# endif
51+
#endif
3952
#endif
4053

4154
#if !defined(SWIFT_TYPEDEFS)
@@ -71,53 +84,66 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
7184
# if __has_feature(objc_class_property)
7285
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
7386
# else
74-
# define SWIFT_CLASS_PROPERTY(...)
87+
# define SWIFT_CLASS_PROPERTY(...)
7588
# endif
7689
#endif
77-
78-
#if __has_attribute(objc_runtime_name)
79-
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
80-
#else
81-
# define SWIFT_RUNTIME_NAME(X)
90+
#if !defined(SWIFT_RUNTIME_NAME)
91+
# if __has_attribute(objc_runtime_name)
92+
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
93+
# else
94+
# define SWIFT_RUNTIME_NAME(X)
95+
# endif
8296
#endif
83-
#if __has_attribute(swift_name)
84-
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
85-
#else
86-
# define SWIFT_COMPILE_NAME(X)
97+
#if !defined(SWIFT_COMPILE_NAME)
98+
# if __has_attribute(swift_name)
99+
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
100+
# else
101+
# define SWIFT_COMPILE_NAME(X)
102+
# endif
87103
#endif
88-
#if __has_attribute(objc_method_family)
89-
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
90-
#else
91-
# define SWIFT_METHOD_FAMILY(X)
104+
#if !defined(SWIFT_METHOD_FAMILY)
105+
# if __has_attribute(objc_method_family)
106+
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
107+
# else
108+
# define SWIFT_METHOD_FAMILY(X)
109+
# endif
92110
#endif
93-
#if __has_attribute(noescape)
94-
# define SWIFT_NOESCAPE __attribute__((noescape))
95-
#else
96-
# define SWIFT_NOESCAPE
111+
#if !defined(SWIFT_NOESCAPE)
112+
# if __has_attribute(noescape)
113+
# define SWIFT_NOESCAPE __attribute__((noescape))
114+
# else
115+
# define SWIFT_NOESCAPE
116+
# endif
97117
#endif
98-
#if __has_attribute(ns_consumed)
99-
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
100-
#else
101-
# define SWIFT_RELEASES_ARGUMENT
118+
#if !defined(SWIFT_RELEASES_ARGUMENT)
119+
# if __has_attribute(ns_consumed)
120+
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
121+
# else
122+
# define SWIFT_RELEASES_ARGUMENT
123+
# endif
102124
#endif
103-
#if __has_attribute(warn_unused_result)
104-
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
105-
#else
106-
# define SWIFT_WARN_UNUSED_RESULT
125+
#if !defined(SWIFT_WARN_UNUSED_RESULT)
126+
# if __has_attribute(warn_unused_result)
127+
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
128+
# else
129+
# define SWIFT_WARN_UNUSED_RESULT
130+
# endif
107131
#endif
108-
#if __has_attribute(noreturn)
109-
# define SWIFT_NORETURN __attribute__((noreturn))
110-
#else
111-
# define SWIFT_NORETURN
132+
#if !defined(SWIFT_NORETURN)
133+
# if __has_attribute(noreturn)
134+
# define SWIFT_NORETURN __attribute__((noreturn))
135+
# else
136+
# define SWIFT_NORETURN
137+
# endif
112138
#endif
113139
#if !defined(SWIFT_CLASS_EXTRA)
114-
# define SWIFT_CLASS_EXTRA
140+
# define SWIFT_CLASS_EXTRA
115141
#endif
116142
#if !defined(SWIFT_PROTOCOL_EXTRA)
117-
# define SWIFT_PROTOCOL_EXTRA
143+
# define SWIFT_PROTOCOL_EXTRA
118144
#endif
119145
#if !defined(SWIFT_ENUM_EXTRA)
120-
# define SWIFT_ENUM_EXTRA
146+
# define SWIFT_ENUM_EXTRA
121147
#endif
122148
#if !defined(SWIFT_CLASS)
123149
# if __has_attribute(objc_subclassing_restricted)
@@ -137,28 +163,25 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
137163
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
138164
# endif
139165
#endif
140-
141166
#if !defined(SWIFT_PROTOCOL)
142167
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
143168
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
144169
#endif
145-
146170
#if !defined(SWIFT_EXTENSION)
147171
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
148172
#endif
149-
150173
#if !defined(OBJC_DESIGNATED_INITIALIZER)
151174
# if __has_attribute(objc_designated_initializer)
152175
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
153176
# else
154-
# define OBJC_DESIGNATED_INITIALIZER
177+
# define OBJC_DESIGNATED_INITIALIZER
155178
# endif
156179
#endif
157180
#if !defined(SWIFT_ENUM_ATTR)
158-
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
181+
# if __has_attribute(enum_extensibility)
159182
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
160183
# else
161-
# define SWIFT_ENUM_ATTR(_extensibility)
184+
# define SWIFT_ENUM_ATTR(_extensibility)
162185
# endif
163186
#endif
164187
#if !defined(SWIFT_ENUM)
@@ -187,14 +210,16 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
187210
#if !defined(SWIFT_DEPRECATED_MSG)
188211
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
189212
#endif
190-
#if __has_feature(attribute_diagnose_if_objc)
191-
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
192-
#else
193-
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
213+
#if !defined(SWIFT_DEPRECATED_OBJC)
214+
# if __has_feature(attribute_diagnose_if_objc)
215+
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
216+
# else
217+
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
218+
# endif
194219
#endif
195220
#if defined(__OBJC__)
196221
#if !defined(IBSegueAction)
197-
# define IBSegueAction
222+
# define IBSegueAction
198223
#endif
199224
#endif
200225
#if !defined(SWIFT_EXTERN)
@@ -207,26 +232,31 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
207232
#if !defined(SWIFT_CALL)
208233
# define SWIFT_CALL __attribute__((swiftcall))
209234
#endif
235+
#if !defined(SWIFT_INDIRECT_RESULT)
236+
# define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result))
237+
#endif
238+
#if !defined(SWIFT_CONTEXT)
239+
# define SWIFT_CONTEXT __attribute__((swift_context))
240+
#endif
241+
#if !defined(SWIFT_ERROR_RESULT)
242+
# define SWIFT_ERROR_RESULT __attribute__((swift_error_result))
243+
#endif
210244
#if defined(__cplusplus)
211-
#if !defined(SWIFT_NOEXCEPT)
212245
# define SWIFT_NOEXCEPT noexcept
213-
#endif
214246
#else
215-
#if !defined(SWIFT_NOEXCEPT)
216247
# define SWIFT_NOEXCEPT
217248
#endif
249+
#if defined(_WIN32)
250+
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
251+
# define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport)
218252
#endif
219-
#if defined(__cplusplus)
220-
#if !defined(SWIFT_CXX_INT_DEFINED)
221-
#define SWIFT_CXX_INT_DEFINED
222-
namespace swift {
223-
using Int = ptrdiff_t;
224-
using UInt = size_t;
225-
}
253+
#else
254+
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
255+
# define SWIFT_IMPORT_STDLIB_SYMBOL
226256
#endif
227257
#endif
228258
#if defined(__OBJC__)
229-
#if __has_feature(modules)
259+
#if __has_feature(objc_modules)
230260
#if __has_warning("-Watimport-in-framework-header")
231261
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
232262
#endif
@@ -259,6 +289,13 @@ SWIFT_CLASS("_TtC9StoreKit216StoreKitAppStore")
259289
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
260290
@end
261291

292+
293+
SWIFT_CLASS("_TtC9StoreKit219StoreKitTransaction")
294+
@interface StoreKitTransaction : NSObject
295+
+ (void)beginRefundRequestFor:(uint64_t)transactionId in:(UIWindowScene * _Nonnull)scene completionHandler:(void (^ _Nonnull)(NSError * _Nullable))completionHandler;
296+
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
297+
@end
298+
262299
#endif
263300
#if defined(__cplusplus)
264301
#endif
Binary file not shown.

0 commit comments

Comments
 (0)