objc2_store_kit/generated/
SKPaymentQueue.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 #[deprecated = "No longer supported"]
15 pub struct SKPaymentQueue;
16);
17
18unsafe impl Send for SKPaymentQueue {}
19
20unsafe impl Sync for SKPaymentQueue {}
21
22extern_conformance!(
23 unsafe impl NSObjectProtocol for SKPaymentQueue {}
24);
25
26impl SKPaymentQueue {
27 extern_methods!(
28 #[deprecated = "No longer supported"]
29 #[unsafe(method(delegate))]
30 #[unsafe(method_family = none)]
31 pub unsafe fn delegate(
32 &self,
33 ) -> Option<Retained<ProtocolObject<dyn SKPaymentQueueDelegate>>>;
34
35 #[deprecated = "No longer supported"]
39 #[unsafe(method(setDelegate:))]
40 #[unsafe(method_family = none)]
41 pub unsafe fn setDelegate(
42 &self,
43 delegate: Option<&ProtocolObject<dyn SKPaymentQueueDelegate>>,
44 );
45
46 #[cfg(feature = "SKStorefront")]
47 #[deprecated = "Use Storefront.current"]
48 #[unsafe(method(storefront))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn storefront(&self) -> Option<Retained<SKStorefront>>;
51
52 #[deprecated = "No longer supported"]
53 #[unsafe(method(defaultQueue))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn defaultQueue() -> Retained<Self>;
56
57 #[deprecated = "Use AppStore.canMakePayments"]
58 #[unsafe(method(canMakePayments))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn canMakePayments() -> bool;
61
62 #[cfg(feature = "SKPayment")]
63 #[deprecated = "Use Product.purchase(confirmIn:options:)"]
64 #[unsafe(method(addPayment:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn addPayment(&self, payment: &SKPayment);
67
68 #[deprecated = "Use AppStore.sync()"]
69 #[unsafe(method(restoreCompletedTransactions))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn restoreCompletedTransactions(&self);
72
73 #[deprecated = "Use AppStore.sync()"]
74 #[unsafe(method(restoreCompletedTransactionsWithApplicationUsername:))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn restoreCompletedTransactionsWithApplicationUsername(
77 &self,
78 username: Option<&NSString>,
79 );
80
81 #[cfg(feature = "SKPaymentTransaction")]
82 #[deprecated = "Use Transaction.finish()"]
83 #[unsafe(method(finishTransaction:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn finishTransaction(&self, transaction: &SKPaymentTransaction);
86
87 #[cfg(feature = "SKDownload")]
88 #[deprecated = "Hosted content is no longer supported"]
89 #[unsafe(method(startDownloads:))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn startDownloads(&self, downloads: &NSArray<SKDownload>);
92
93 #[cfg(feature = "SKDownload")]
94 #[deprecated = "Hosted content is no longer supported"]
95 #[unsafe(method(pauseDownloads:))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn pauseDownloads(&self, downloads: &NSArray<SKDownload>);
98
99 #[cfg(feature = "SKDownload")]
100 #[deprecated = "Hosted content is no longer supported"]
101 #[unsafe(method(resumeDownloads:))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn resumeDownloads(&self, downloads: &NSArray<SKDownload>);
104
105 #[cfg(feature = "SKDownload")]
106 #[deprecated = "Hosted content is no longer supported"]
107 #[unsafe(method(cancelDownloads:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn cancelDownloads(&self, downloads: &NSArray<SKDownload>);
110
111 #[deprecated = "Use Transaction.updates or PurchaseResult from Product.purchase(confirmIn:options:)"]
112 #[unsafe(method(addTransactionObserver:))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn addTransactionObserver(
115 &self,
116 observer: &ProtocolObject<dyn SKPaymentTransactionObserver>,
117 );
118
119 #[deprecated = "No longer supported"]
120 #[unsafe(method(removeTransactionObserver:))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn removeTransactionObserver(
123 &self,
124 observer: &ProtocolObject<dyn SKPaymentTransactionObserver>,
125 );
126
127 #[deprecated = "Use Transaction.updates or PurchaseResult from Product.purchase(confirmIn:options:)"]
133 #[unsafe(method(transactionObservers))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn transactionObservers(
136 &self,
137 ) -> Retained<NSArray<ProtocolObject<dyn SKPaymentTransactionObserver>>>;
138
139 #[cfg(feature = "SKPaymentTransaction")]
140 #[deprecated = "Use Transaction.unfinished"]
146 #[unsafe(method(transactions))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn transactions(&self) -> Retained<NSArray<SKPaymentTransaction>>;
149
150 #[deprecated = "Use Message.messages and Message.display(in:)"]
151 #[unsafe(method(showPriceConsentIfNeeded))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn showPriceConsentIfNeeded(&self);
154
155 #[deprecated = "Use AppStore.presentOfferCodeRedeemSheet(in:)"]
156 #[unsafe(method(presentCodeRedemptionSheet))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn presentCodeRedemptionSheet(&self);
159 );
160}
161
162impl SKPaymentQueue {
164 extern_methods!(
165 #[unsafe(method(init))]
166 #[unsafe(method_family = init)]
167 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
168
169 #[unsafe(method(new))]
170 #[unsafe(method_family = new)]
171 pub unsafe fn new() -> Retained<Self>;
172 );
173}
174
175extern_protocol!(
176 #[deprecated = "No longer supported"]
178 pub unsafe trait SKPaymentQueueDelegate: NSObjectProtocol {
179 #[cfg(all(feature = "SKPaymentTransaction", feature = "SKStorefront"))]
180 #[deprecated = "Pass Product.PurchaseOption.onStorefrontChange(shouldContinuePurchase:) to product.purchase(options:)"]
181 #[optional]
182 #[unsafe(method(paymentQueue:shouldContinueTransaction:inStorefront:))]
183 #[unsafe(method_family = none)]
184 unsafe fn paymentQueue_shouldContinueTransaction_inStorefront(
185 &self,
186 payment_queue: &SKPaymentQueue,
187 transaction: &SKPaymentTransaction,
188 new_storefront: &SKStorefront,
189 ) -> bool;
190
191 #[deprecated = "Use Message.messages and Message.display(in:)"]
192 #[optional]
193 #[unsafe(method(paymentQueueShouldShowPriceConsent:))]
194 #[unsafe(method_family = none)]
195 unsafe fn paymentQueueShouldShowPriceConsent(&self, payment_queue: &SKPaymentQueue)
196 -> bool;
197 }
198);
199
200extern_protocol!(
201 #[deprecated = "Use StoreKit 2 Transaction APIs"]
203 pub unsafe trait SKPaymentTransactionObserver: NSObjectProtocol {
204 #[cfg(feature = "SKPaymentTransaction")]
205 #[deprecated = "Use StoreKit 2 Transaction APIs"]
206 #[unsafe(method(paymentQueue:updatedTransactions:))]
207 #[unsafe(method_family = none)]
208 unsafe fn paymentQueue_updatedTransactions(
209 &self,
210 queue: &SKPaymentQueue,
211 transactions: &NSArray<SKPaymentTransaction>,
212 );
213
214 #[cfg(feature = "SKPaymentTransaction")]
215 #[deprecated = "Use StoreKit 2 Transaction APIs"]
216 #[optional]
217 #[unsafe(method(paymentQueue:removedTransactions:))]
218 #[unsafe(method_family = none)]
219 unsafe fn paymentQueue_removedTransactions(
220 &self,
221 queue: &SKPaymentQueue,
222 transactions: &NSArray<SKPaymentTransaction>,
223 );
224
225 #[deprecated = "Use AppStore.sync()"]
226 #[optional]
227 #[unsafe(method(paymentQueue:restoreCompletedTransactionsFailedWithError:))]
228 #[unsafe(method_family = none)]
229 unsafe fn paymentQueue_restoreCompletedTransactionsFailedWithError(
230 &self,
231 queue: &SKPaymentQueue,
232 error: &NSError,
233 );
234
235 #[deprecated = "Use AppStore.sync()"]
236 #[optional]
237 #[unsafe(method(paymentQueueRestoreCompletedTransactionsFinished:))]
238 #[unsafe(method_family = none)]
239 unsafe fn paymentQueueRestoreCompletedTransactionsFinished(&self, queue: &SKPaymentQueue);
240
241 #[cfg(feature = "SKDownload")]
242 #[deprecated = "Hosted content is no longer supported"]
243 #[optional]
244 #[unsafe(method(paymentQueue:updatedDownloads:))]
245 #[unsafe(method_family = none)]
246 unsafe fn paymentQueue_updatedDownloads(
247 &self,
248 queue: &SKPaymentQueue,
249 downloads: &NSArray<SKDownload>,
250 );
251
252 #[cfg(all(feature = "SKPayment", feature = "SKProduct"))]
253 #[deprecated = "Use PurchaseIntent.intents"]
254 #[optional]
255 #[unsafe(method(paymentQueue:shouldAddStorePayment:forProduct:))]
256 #[unsafe(method_family = none)]
257 unsafe fn paymentQueue_shouldAddStorePayment_forProduct(
258 &self,
259 queue: &SKPaymentQueue,
260 payment: &SKPayment,
261 product: &SKProduct,
262 ) -> bool;
263
264 #[deprecated = "Use Storefront.updates"]
265 #[optional]
266 #[unsafe(method(paymentQueueDidChangeStorefront:))]
267 #[unsafe(method_family = none)]
268 unsafe fn paymentQueueDidChangeStorefront(&self, queue: &SKPaymentQueue);
269
270 #[deprecated = "Use Transaction.updates"]
271 #[optional]
272 #[unsafe(method(paymentQueue:didRevokeEntitlementsForProductIdentifiers:))]
273 #[unsafe(method_family = none)]
274 unsafe fn paymentQueue_didRevokeEntitlementsForProductIdentifiers(
275 &self,
276 queue: &SKPaymentQueue,
277 product_identifiers: &NSArray<NSString>,
278 );
279 }
280);