In-App Purchase

RSS for tag

Offer extra content, digital goods, and features directly within your app using in-app purchases.

In-App Purchase Documentation

Posts under In-App Purchase tag

785 results found
Sort by:
Post not yet marked as solved
295 Views

Does apple send notification for subscription expiry if auto-renew is turned off?

I am using App Store Server notifications. Let say user has purchased an auto-renewable subscription for one-month and after 1 day, he turned off the auto-renew from their apple id settings. Apple is sending the STATUS change notification. I want to know that after 1 month, will apple send the EXPIRY notification?
Asked
by mib-usman.
Last updated
.
Post not yet marked as solved
15 Views

Problems with using Apple Hosted Content for downloading In-App purchased content

Hi, I'm experiencing multiple problems when trying to restore In-app purchased contents through Apple Hosted Content. The device I'm using is iPad / OS 14.7.1 Problem A : Crash Launch the app call '[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];' to create transactions for the contents. -> This results in 'updatedTransactions' method to be invoked. In 'updatedTransactions', for each transaction, I call '[[SKPaymentQueue defaultQueue] startDownloads' for the downloads attached to the transaction. Before the downloads are completed, I finish the transactions by calling '[[SKPaymentQueue defaultQueue] finishTransaction];' for each transaction. After wating a while, an exception is raised with the message as below and the app crashes with it. *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]' terminating with uncaught exception of type NSException By observing the logs from 'appstored', I believe this exception is raised when the download process in the background is completed. This means although 'finishTransaction' was called for the transaction, the download process for the transaction didn't get terminated. I found out that this exception doesn't happen if there is no 'updatedDownloads' method implemented in my transaction observer. Problem B : Multiple download sessions for the same transaction. Launch the app call '[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];' to create transactions for the contents. -> This results in 'updatedTransactions' method to be invoked. In 'updatedTransactions', for each transaction, I call '[[SKPaymentQueue defaultQueue] startDownloads' for the downloads attached to the transaction. Before the downloads are completed, close the app. Launch the app again I observe that 'updatedTransactions' method is invoked with the transactions from the previous run of the app which is expected as 'finishTransaction' was not called for the transactions. In updatedTransactions method, I call 'startDownloads' for each transaction. This is where I get confused. Obviously, downloads are started for the transactions in the previous run. However, in this run, when 'updatedTransactions' is invoked, the downloads in the transactions has their state as 'waiting'. And if I don't call 'startDownloads' for the transactions, 'updatedDownloads' is not invoked. So, I have no choice but to call 'startDownloads' again for the transactions so that I get 'updatedDownloads' invoked. So, by calling 'startDownloads' for the transactions, 'updatedDownloads' are invoked. However, by observing the logs from appstored service, I noticed that by calling 'startDownloads' again for the transactions, it creates a second instance of the download process. And, having multiple instances of the same download process leads to download failures where the second download fails to copy the content to the destination folder because the destination folder is not empty because the first download already copied the content in the same location.
Asked
by Sugu1111.
Last updated
.
Post not yet marked as solved
608 Views

Error thrown when querying for Subscription Products

Hi, I have been testing StoreKit 2. I'm trying to query for available subscription products by using the following query code as per the document. I have configured the in-app purchases with subscriptions in appstoreconnect. The request query keeps throwing an error. Would appreciate some help. Query Code let productIdentifiers: Set = ["monthly_subscription", "yearly_subscription", "family_monthly_subscription", "family_yearly_subscription"]         async {             do {                 let _subscribableProducts = try await Product.request(with: productIdentifiers)                 self.subscribableProducts = _subscribableProducts             }             catch {                 print("Something went wronge \(error)")             }         } Error thrown systemError(Error Domain=ASDErrorDomain Code=507 "Error decoding response" UserInfo={NSLocalizedDescription=Error decoding response, NSLocalizedFailureReason=Could not decode media products response})
Asked Last updated
.
Post not yet marked as solved
78 Views

How to handle the display of a upgrade / downgrade of a subscription

Hello, We want to implement a view that let the user change his current subscription. We have 4 subscriptions with 2 different levels. Each level have a monthly and annual subscription. All the subscriptions are inside the same group. So the user should be able to only have 1 subscription active at any time. Inside the view, we display the current subscription that the user have. But with the downgrade or change of periodicity of the subscription, we have an issue. The subscription that will b renewed (the last one that the user has selected) is not the currently active subscription. What's the best practice in this case ? Also we faced a similar issue doing this test: I take a Level 2 (Liberty) annual subscription I change it to a monthly subscription (it will change in 1 year). I upgrade it to a Level 1 (Premium) monthly subscription. Here is what I got from the receipt (tested with a trial period active): "latest_receipt_info": [ { "expires_date": "2021-10-09 17:31:29 Etc/GMT", "expires_date_ms": "1633800689000", "expires_date_pst": "2021-10-09 10:31:29 America/Los_Angeles", "in_app_ownership_type": "PURCHASED", "is_in_intro_offer_period": "false", "is_trial_period": "true", "original_purchase_date": "2021-09-09 17:31:30 Etc/GMT", "original_purchase_date_ms": "1631208690000", "original_purchase_date_pst": "2021-09-09 10:31:30 America/Los_Angeles", "original_transaction_id": "", "product_id": "subscription_premium_1_month", "purchase_date": "2021-09-09 17:32:41 Etc/GMT", "purchase_date_ms": "1631208761000", "purchase_date_pst": "2021-09-09 10:32:41 America/Los_Angeles", "quantity": "1", "subscription_group_identifier": "20792147", "transaction_id": "", "web_order_line_item_id": "" }, { "expires_date": "2021-10-09 17:31:29 Etc/GMT", "expires_date_ms": "1633800689000", "expires_date_pst": "2021-10-09 10:31:29 America/Los_Angeles", "in_app_ownership_type": "PURCHASED", "is_in_intro_offer_period": "false", "is_trial_period": "true", "is_upgraded": "true", "original_purchase_date": "2021-09-09 17:31:30 Etc/GMT", "original_purchase_date_ms": "1631208690000", "original_purchase_date_pst": "2021-09-09 10:31:30 America/Los_Angeles", "original_transaction_id": "", "product_id": "subscription_liberty_1_year", "purchase_date": "2021-09-09 17:31:29 Etc/GMT", "purchase_date_ms": "1631208689000", "purchase_date_pst": "2021-09-09 10:31:29 America/Los_Angeles", "quantity": "1", "subscription_group_identifier": "20792147", "transaction_id": "", "web_order_line_item_id": "" } ], "pending_renewal_info": [ { "auto_renew_product_id": "subscription_premium_1_month", "auto_renew_status": "1", "original_transaction_id": "", "product_id": "subscription_premium_1_month" } ], In this case what should I display for the user as active subscription and/or pending for renewal subscription? Thank you for your time and guidance. Regards,
Asked Last updated
.
Post not yet marked as solved
33 Views

Code Redemption Testing

Hi! We have implemented the redemption of offer codes using the function SKPaymentQueue.default().presentCodeRedemptionSheet() The redemption view appears correctly and the flow ends successfully, we receive the callback from apple on the server side, the problem is that we do not receive feedback on the app side and we cannot guarantee a good user experience. in particular it seems that the function paymentQueue (_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) is not called, but we are not sure. The standard app purchase flow works fine, but code redemption does not. In general it is very difficult to test these discount codes because they are only testable with the app in production, without being able to take advantage of the debug prints or breakpoints. In addition, a particular offer can only be redeemed once per apple id Is there any way to test offer codes in debug mode? How could we do some tests on the code without having to send the app for verification every time? Thank you!
Asked
by btdev.
Last updated
.
Post not yet marked as solved
32 Views

Auto renew not working in app purchase in swift

I am working on project in which subscription is required. So in that Once I Sign out and do the subscription of purchase than my app work's fine. But Sometimes when I do subscription I get message on console of Subscription Successfull but actually the Subscription is Unsuccessfull. This is my app purchase code of activePurchase which is not working and in paymentQueue code only goes for first time after the sign in but doesn't work everytime func payments(productID : String){ if SKPaymentQueue.canMakePayments(){ SVProgressHUD.show() let paymentRequest = SKMutablePayment() paymentRequest.productIdentifier = productID SKPaymentQueue.default().add(paymentRequest) }else{ SVProgressHUD.showError(withStatus: "User unable to make payment") print("DEBUG: - User unable to make payment!") } } func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) { for transaction in transactions{ switch (transaction.transactionState) { case .purchasing: print("DEBUG: - Purchasing... From category") case .purchased: print("DEBUG: - Yuppy!!!") SVProgressHUD.show() SKPaymentQueue.default().finishTransaction(transaction) SKPaymentQueue.default().remove(self) print("DEBUG: Transecton - \(transaction)") let transid = "\(transaction.transactionIdentifier!)" validate() //riceptData() print("DEBUG: Call InApp From Category!") SVProgressHUD.showSuccess(withStatus: "Purchase Successfully!") self.dismiss(animated: true, completion: nil) case .deferred: print("DEBUG: - Payment Failed") SKPaymentQueue.default().finishTransaction(transaction) SKPaymentQueue.default().remove(self) svProgressHUD.dismiss() case .failed: print("DEBUG: - Payment Failed") SKPaymentQueue.default().finishTransaction(transaction) SKPaymentQueue.default().remove(self) svProgressHUD.dismiss() default: SKPaymentQueue.default().finishTransaction(transaction) SKPaymentQueue.default().remove(self) svProgressHUD.dismiss() print("DEBUG: - Something went wrong.") } } }
Asked
by besmart.
Last updated
.
Post not yet marked as solved
1.2k Views

Original_transaction_id and transaction_id are the same when renewing subscription. Behavior changed with last week. It is a sandbox environment.

Today, I confirmed the sandbox environment for the receipt of my subscription.original_transaction_id has been changed each time the subscription is renewed.The original_transaction_id is set to the same value as the transaction_id of the renewal of the subscription.Until last week, original_transaction_id always had the first transaction_id set.Was the specification changed?Or is it a sandbox environment bug?The guidelines have the following description.This value is the same for every specific subscription. This value is useful for relating together multiple iOS 6 style transaction receipts for the same individual customer's subscription.
Asked
by matchoda.
Last updated
.
Post not yet marked as solved
390 Views

original_transaction_id changing

I am implementing IAP for an autorenewable subscription. I decode the receipt on the device. I noticed in the sandbox that the original_transaction_id is changing for each renewal. (It is always the same as the transaction_id which differs for each renewal, as it should.) Can anyone confirm that this is NOT what happens in production?A WWDC video states that the original_transaction_id for an autorenewable subscription can be used to associate different devices owned by the same user. I had always thought that the original_transaction_id would differ from device to device. Can anyone confirm that in production the original_transaction_id is the same across all devices owned by the same user for an autorenewable subscription?
Asked
by PBK.
Last updated
.
Post not yet marked as solved
62 Views

In App Purchase Trial Period (30 Days) Exact

I want to set exact 30 days free trial for the very first time the user downloads the application and selects the free trial option, Currently in the App Store console it is showing the Option of “1 Month”. Does that mean 30 days OR 31 Days ? Is there any possible solution where we can put exact 30 days as the trial period in my in app purchase subscription ? Can anyone please reply this at the soonest. Thanks in Advance!
Asked Last updated
.
Post not yet marked as solved
129 Views

My Account Status is pending

I got the reply to Photo ID Required. I did that and the next email tells me: Thank you for providing the documents we requested. We will review them and follow up with you within two business days. Best regards, Apple Developer Program Support That's 3 days ago, so what happening with apple support?
Asked Last updated
.
Post not yet marked as solved
57 Views

The restore button with non-consumable In-App Purchases

Hi, I am working on the app that offers non-consumable In-App Purchases to the user. When user buys them, we link them to the user's account. After successful payment transaction, info about bought product will be sent to the backend and linked with the user's account. So user can have access to purchased content whenever he/she logs in in the app. Is this enough, or we still need to show the restore button to the user (for example on the profile tab) to give him option to restore products? Kind regards and thanks in advance!
Asked Last updated
.
Post not yet marked as solved
1.6k Views

App Store Connect, Subscription prices

At App Store connect, as soon I try to select a price for a new subscription an error message is displayed: "There was a problem retrieving the data for this page. Please try again." Anyone can help me? I need this asap :(
Asked Last updated
.
Post not yet marked as solved
44 Views

Offer Tiered Pricing for Full App

Hi everyone, I had a quick question, is it possible to offer tiered pricing after a 7-day non-consumable subscription for early beta users rather than forcing them to pay full price. They could possibly enter a one-time code that offers them another non-consumable purchase that costs $5 rather than other users who will pay $20 to unlock the app features. Thanks
Asked
by sfsoisss.
Last updated
.
Post not yet marked as solved
40 Views

Do the offer code benefits overlap?

I would like to give the person who introduced the app a one-month free subscription benefit with an offer code. What happens if you introduce the first person and then introduce the second person during the free period? for example Payment date:09/01 Introducing the app to the first person → 10/01 Introducing the app to the second person→ 11/01 ?
Asked Last updated
.