Signed renewal info from 'Get Subscription Statuses' or in server notifications never has the offerType or offerDiscountType even when the corresponding transaction does have those values set.
Our offer is a free trial.
Do these properties refer to something different in JWSRenewalInfoDecodedPayload than they do in transactions?
I'm trying to determine whether a subscription (identified by originalTransactionId) is currently in a free trial based on server notifications. The status doesn't tell us if the subscription is currently in free trial and the signedTransactionInfo may be for an older transaction.
Subscriptions
RSS for tagGive users access to content, services, or premium features in your app on an ongoing basis with subscriptions, a type of in-app purchase.
Posts under Subscriptions tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hello, I'm using the App Store Connect API to check and modify subscription prices. I know there can be only 1 outstanding future price change for subscription pricing, so I check for any scheduled future price changes (after today's date) and then delete them before setting new ones.
This works 95% of the time -- except in the last little bit before the date changes. For example, if it is 1 hour before midnight and tomorrow's date is when the scheduled price change goes into effect, when I try to delete, I'll get something like this:
The request failed with response code 409 ENTITY_ERROR.
There is a problem with the request entity. Cannot delete Subscription Price with id . Only future price changes can be deleted.
If I look at the same subscription in App Store Connect, it will still show it as a future price change, and won't show the usual buttons to modify or delete it. However, in App Store Connect, I can still hit the "+" button to create a new price change and it will successfully delete and replace the pending price change, which will then appear with the usual Delete and Edit buttons.
My first thought was that maybe it was a timezone issue, but if I go to put the new pricing into effect, that request fails with an error like this:
"errors" : [ {
"id" : "5a51c570-1f38-4fa0-b490-9fa979f4aecf",
"status" : "409",
"code" : "STATE_ERROR",
"title" : "The request cannot be fulfilled because of the state of another resource.",
"detail" : "Must delete future price change before creating a new price change."
} ]
So... my questions are:
Is this expected behavior?
How can App Store Connect replace the pending price change in the final hours but I can't do it with the API?
As a workaround, is there a set amount of time before the price change goes into effect where the prices should no longer be editable?
Thanks!
I am in Apple Connect and in order to sell my Subsricptions in my mobile app i need to agree to the DSA and fill in my contact information.
i do so, but only my email gets a verification code meanwhile my phone does not get one! I tried sms and call but both did not work.
because i cant verify i cant agree and because of that i cant sell my subsription?!!
*** is this clown show???
Hello!
How can I set appAccountToken when I'm using the new SwiftUI view SubscriptionStoreView for subscription?
Previously I was able to set it as a purchase option here https://developer.apple.com/documentation/storekit/product/purchase(options:) but I don't see purchase options with SubscriptionStoreView.
Thank you,
sendai
I read the documentation and it told I had to prepare the product on App Store connect and once it is at the state "Ready to submit" I could access it on a phone where I am connected with an Icloud account in the developper list of the apple development account.
This is what I've done but when I try to fetch in my flutter code the product with the id I set in App Store connect it says "No product found"
Here is where I fetch the product:
Future purchaseProduct(String productId) async {
try {
Set<String> _pIds = {productId};
final ProductDetailsResponse response =
await _iap.queryProductDetails(_pIds);
if (response.productDetails.isEmpty) {
throw 'Product not found';
}
final ProductDetails productDetails = response.productDetails.first;
final PurchaseParam purchaseParam =
PurchaseParam(productDetails: productDetails);
_iap.buyConsumable(purchaseParam: purchaseParam);
} catch (e) {
Services.debugLog('Error purchasing product: $e');
throw e;
}
}
I checked the product ID and it does not seems to be the problem. Is there some other steps I need to do ?
The application is developed with Xamarin Framework and it is live now.
The customer installed the app and purchased the annual subscription.
And for some reason, they uninstall and reinstall the application on the same device.
Now user wants to restore the subscription. In the application, there is an option to Restore the subscription. But restore API not return purchase details.
But when clicking the subscription button instead of restoring the subscription, it says you subscribed to this plan".
is there any possibility of not getting VerifyRecipt even after a successful purchase?
xin chào tôi muốn mã sử dụng Testflight hoặc một số trợ giúp để tôi có thể sử dụng testflight
I am currently using StoreKit2 to set up the in-app purchase subscription flow, and I have already configured the subscription products in App Connect. I created a StoreKit Configuration file in Xcode and used it in the scheme. However, after completing the purchase, the transaction.jsonRepresentation data returns a transactionId of 0. After checking the documentation, I found that I need to disable the StoreKit Configuration and enable Sandbox Testing. But after disabling the StoreKit Configuration, I can't retrieve the real product data using Product.products(for: productIds). I can confirm that the ProductId I provided is real and matches the data configured in App Connect. Could you please help me identify the issue? Thank you
I am currently using StoreKit2 to set up the in-app purchase subscription flow, and I have already configured the subscription products in App Connect. I created a StoreKit Configuration file in Xcode and used it in the scheme. However, after completing the purchase, the transaction.jsonRepresentation data returns a transactionId of 0. After checking the documentation, I found that I need to disable the StoreKit Configuration and enable Sandbox Testing. But after disabling the StoreKit Configuration, I can't retrieve the real product data using Product.products(for: productIds). I can confirm that the ProductId I provided is real and matches the data configured in App Connect. Could you please help me identify the issue?
Hello Apple Team,
We have recently updated our app and followed all the required steps for approving auto-renewable subscriptions. Our app update (Version 1.0.4, Build 5) has been reviewed and released on the App Store, but our subscription is still in “Waiting for Review” status.
We have made the necessary corrections:
✔️ Clearly indicated the subscription duration in the app UI (“Lite plan: Full access for 1 month. Auto-renewing.”)
✔️ Added the Terms of Use link in App Store Connect metadata
✔️ Updated our Privacy Policy link
However, when users attempt to subscribe, they receive an error.
Could you clarify why the subscription has not been reviewed along with the app?
Thank you for your assistance!
Hello everyone.
When I try to start the enrollment in the program, I receive the following message: Your enrollment in the Apple Developer Program could not be completed at this time.
Does anyone know how to solve this problem?
I've noticed that CONSUMPTION_REQUEST notifications sometimes have a signedTransactionInfo which corresponds not to the latest transaction, but to an earlier transaction in a subscription.
Is this expected? I thought signedTransactionInfo was always the latest subscription information?
Are there any other notification types for which signedTransactionInfo can be out of date?
My question is simple, I do not have much experience in writing swift code, I am only doing it to create a small executable that I can call from my python application which completes Subcription Management.
I was hoping someone with more experience could point out my flaws along with giving me tips on how to verify that the check is working for my applicaiton. Any inight is appreciated, thank you.
import Foundation
import StoreKit
class SubscriptionValidator {
static func getReceiptURL() -> URL? {
guard let appStoreReceiptURL = Bundle.main.appStoreReceiptURL else {
print("No receipt found.")
return nil
}
return appStoreReceiptURL
}
static func validateReceipt() -> Bool {
guard let receiptURL = getReceiptURL(),
let receiptData = try? Data(contentsOf: receiptURL) else {
print("Could not read receipt.")
return false
}
let receiptString = receiptData.base64EncodedString()
let validationResult = sendReceiptToApple(receiptString: receiptString)
return validationResult
}
static func sendReceiptToApple(receiptString: String) -> Bool {
let isSandbox = Bundle.main.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt"
let urlString = isSandbox ? "https://sandbox.itunes.apple.com/verifyReceipt" : "https://buy.itunes.apple.com/verifyReceipt"
let url = URL(string: urlString)!
let requestData: [String: Any] = [
"receipt-data": receiptString,
"password": "0b7f88907b77443997838c72be52f5fc"
]
guard let requestBody = try? JSONSerialization.data(withJSONObject: requestData) else {
print("Error creating request body.")
return false
}
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.httpBody = requestBody
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let semaphore = DispatchSemaphore(value: 0)
var isValid = false
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data, error == nil,
let jsonResponse = try? JSONSerialization.jsonObject(with: data) as? [String: Any],
let status = jsonResponse["status"] as? Int else {
print("Receipt validation failed.")
semaphore.signal()
return
}
if status == 0, let receipt = jsonResponse["receipt"] as? [String: Any],
let inApp = receipt["in_app"] as? [[String: Any]] {
for purchase in inApp {
if let expiresDateMS = purchase["expires_date_ms"] as? String,
let expiresDate = Double(expiresDateMS) {
let expiryDate = Date(timeIntervalSince1970: expiresDate / 1000.0)
if expiryDate > Date() {
isValid = true
}
}
}
}
semaphore.signal()
}
task.resume()
semaphore.wait()
return isValid
}
}
Hello,
I originally reported this issue on December 13, 2024, and received a case ID from Apple Developer Program Support: 102485600459.
However, the issue remains unresolved, and I have not received any further updates. Could someone please assist me in getting this matter addressed? Any guidance or escalation options would be greatly appreciated.
Thank you.
I am currently testing my in app subscription via sandbox. I am able to make the purchase and verify it, but it will not auto renew. The sandbox account is flagged as being subscribed, so it can't be purchased again, but I don't actually get the auto renewal.
I did notice that randomly on app boot up, I'll get a bunch of the backlogged auto renewals come in, but they are never actually sent to me when the 3 minute expiration is finished.
This is on macOS, so I am not able to actually look at and manage the sandbox subscriptions. It seems like that's only a thing for iOS. Is this just a behavior with the sandbox environment or will this behavior also happen with legitimate App Store?
The code I use is below:
@MainActor
func updateCustomerProductStatus() async {
var purchasedSubscriptions: [Product] = []
for await result in Transaction.currentEntitlements {
do {
let transaction = try checkVerified(result)
switch transaction.productType {
case .autoRenewable:
if let subscription = subscriptions.first(where: { $0.id == transaction.productID}) {
purchasedSubscriptions.append(subscription)
}
default:
break
}
} catch {
print("catching \(error)")
}
}
init() {
subscriptions = []
updateListenerTask = listenForTransactions()
Task {
await requestProducts()
await updateCustomerProductStatus()
}
}
deinit {
updateListenerTask?.cancel()
}
func listenForTransactions() -> Task<Void, Error> {
return Task.detached {
// Iterate through any transactions that don't come from a direct call to `purchase()`.
for await result in Transaction.updates {
do {
let transaction = try self.checkVerified(result)
// Deliver products to the user.
await self.updateCustomerProductStatus()
// Always finish a transaction.
await transaction.finish()
} catch {
// StoreKit has a transaction that fails verification. Don't deliver content to the user.
print("Transaction failed verification.")
}
}
}
}
We have set monthly/yearly subscriptions in our app and they have been approved. The users can get access to the limited functions of the app for free. For example, they can create limited number of tasks/events in the App. But if they want to create more tasks/events in the App, they need to subscribe the app(monthly/yearly).
But we don't know why the app is shown as an one-time purchase app in App store. The users need to pay the one-time purchase fee at first to download the app. If they haven't tried the app, they wont' pay for it. How to fix it? Look forward to the reply about it ASAP.
Hello,
I have a few questions about increasing a price increase for an existing subscription on an iOS application:
1.) Is it possible to test the price increase in the sandbox environment? If so do I have to plan the scheduled increase first or can I create this scenario in the sandbox environment without any scheduling? I ask because id like to test the new price update in some of the local code first without having the risk of a user getting notified that a price increase is coming before the app is ready to display it properly.
2.) When a price increase is scheduled say two weeks out, but then its determined that we need to cancel it by deleting it from app store connect. Are users that were potentially notified of the price increase via the consent form notified a second time that it has been cancelled?
Thanks for any help!
Hello,
I would like to ask about how to handle subscription refund notifications.
Here’s what I’ve done.
Environment: Sandbox
Steps to reproduce
1.Subscribe.
2.Request a refund using beginRefundRequest.
3.Receives App store server notifications.
I expected to receive the EXPIRED notification immediately after receiving the REFUND notification, but I have confirmed that the EXPIRED notification is received on the renewal date.
We plan to restrict access to premium content when receiving the EXPIRED notification.
If a user starts an annual subscription in January and requests a refund after 3 months, will the EXPIRED notification be received in January of the following year?
If so, what is the optimal time to restrict access to premium content?
Additionally, is there a possibility of a partial refund?
Thank you in advance for your support!
Hello all,
In the App Store Connect API:
Apps have /v1/appPriceSchedules/{id}/baseTerritory.
IAPs have /v1/inAppPurchasePriceSchedules/{id}/baseTerritory.
...but:
Auto-renewing subscriptions don't have a corresponding endpoint for getting the base territory
However, the App Store Connect website does indeed require you to set a base territory when creating new auto-renewable subscriptions.
Why's that?
More importantly, what's the best way of determining what to use for a base territory?
Thank you!!
https://developer.apple.com/documentation/appstoreservernotifications/app-store-server-notifications-changelog#June-10-2024
ONE_TIME_CHARGE notify type running in a sandbox environment for almost a year, the feature is not yet available for production environment.
The notification is already available in Google subscriptions.
Our services often miss orders because of the absence of this notification.
Can you give us an approximate time range?