StoreKit

RSS for tag

Support in-app purchases and interactions with the App Store using StoreKit.

Posts under StoreKit tag

181 Posts

Post

Replies

Boosts

Views

Activity

Certificate is not temporally valid
I'm attempting to test an in app purchase for my app on my phone (not in a simulator, not sandbox testing). I'm getting an error that certificate check has failed. Could this have anything to do with the SHA-1 warnings that Apple has recently mentioned? I've tried regenerating my StoreKit file, cleaning the build, restarting XCode, resetting all of my devices purchases from the Debug > StoreKit menu, all with no luck. Any help would be greatly appreciated. 2025-01-10 19:52:19.974564-0500 MyApp[74478:30675548] [Default] Failed to verify certificate chain due to client recoverable failure: Error Domain=NSOSStatusErrorDomain Code=-67818 "“StoreKit Testing in Xcode” certificate is expired" UserInfo={NSLocalizedDescription=“StoreKit Testing in Xcode” certificate is expired, NSUnderlyingError=0x3027b9d40 {Error Domain=NSOSStatusErrorDomain Code=-67818 "Certificate 0 “StoreKit Testing in Xcode” has errors: Certificate is not temporally valid;" UserInfo={NSLocalizedDescription=Certificate 0 “StoreKit Testing in Xcode” has errors: Certificate is not temporally valid;}}} 2025-01-10 19:52:19.978233-0500 MyApp[74478:30675483] [Default] Failed to verify signature for Transaction, will assume invalid: failedToVerifyCertificateChain Purchase succeeded but verification failed: Certificate Chain Invalid Failed to purchase Premium: invalidCertificateChain saveUnencrypted: Started saving form_info.json saveUnencrypted: Saved form_info.json to Documents Directory in 9 ms (JSONEncoder chunk-based copy-on-write, 1 chunks) at ...
3
1
399
Feb ’25
I can't cancel test subscription
When I try to cancel it I get "Your request is temporarily unable to be processed. Please try again". I have since created a new test user from "Users and access", set the renewal for subscriptions to be at 5min. Added the new test user on my iPad where I am developing locally as a sandbox account, and then purchased the same subscription. And same problem happened - I can't cancel it from Apple ID -> Subscriptions. Getting the very same error. Also the subscription there seems to renew on a daily base and not on every 5 minute as I have set it. If I try "Clear purchase history" from the "Users and Access" from AppStore connect - nothing happens, I still see the subscription and I can't purchase it again. Please advise how to proceed in this situation. This happens on iOS 15.5 if it does matter and I am using StoreKit2. Regards, Al
4
1
1.1k
Jan ’25
Create C++ static library with Swift interoperability for iOS. How?
Hello all! My application written with C++ for iOS. Want to make some functionality in static library for the purpose of reuse it in different C++ projects. Want to make universal library for using StoreKit2. Global idea is to wrap StoreKit2 Swift out with CPP interoperability. Now trying to make clear for my self how to create C++ static library with Swift interoperability for iOS in XCode. There are only Objective-C option when you creating static library in XCode for iOS. Is it correct: Create Static Library with Objective-C in XCode Remove all default Objective-C files Add C++ files Add C++/Swift interoperability in build settings Add swift classes Beside all of it some questions: When C++ static library contain Swift code with interoperability will it require some special settings for project (Swift standard lib or some other settings)? Or it could be used like any other C++ libraries? What is the optimal build settings in this case to reduce dependencies when using it different projects? Is there any examples of the same approach for iOS development?
0
0
362
Jan ’25
How to handle a non-consumable in app purchase when SKPaymentQueue is deprecated
I use the code below for a non-consumable in-app purchase in my apps. Has anybody worked out how to handle this without using any of the deprecated items? SKPaymentQueue - deprecated, SKPayment - deprecated, SKProduct - deprecated, transactionState - deprecated, SKPaymentTransaction - deprecated, finishTransaction - deprecated func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool { true } func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) { for transaction in transactions { switch transaction.transactionState { case .purchasing: break case .purchased: SKPaymentQueue.default().finishTransaction(transaction) // Hide the restore button navigationItem.setRightBarButton(nil, animated: true) // Set the ProVerion in the Db to true IAPHandler.setProVersionToPurchased() // Also hide the Purchase button UIView.animate(withDuration: 1.0, animations: { [weak self] in self?.purchaseBtn_Outlet.alpha = 0 }) { [weak self] (success) in if self!.theDevice.isOneOf(K.Device_Groups.SE_3_iPhone8) { self?.segControlTop_Constraint.constant = 10 } else if self!.theDevice.isPhone { self?.segControlTop_Constraint.constant = 30 } } case .failed: if let error = transaction.error { let errorDescription = error.localizedDescription print("Transaction failed due to error: \(errorDescription)") } case .restored: SKPaymentQueue.default().finishTransaction(transaction) // Hide the restore button navigationItem.setRightBarButton(nil, animated: true) // Set the ProVerion in the Db to true IAPHandler.setProVersionToPurchased() // Also hide the Purchase button UIView.animate(withDuration: 1.0, animations: { [weak self] in self?.purchaseBtn_Outlet.alpha = 0 }) { [weak self] (success) in if self!.theDevice.isOneOf(K.Device_Groups.SE_3_iPhone8) { self?.segControlTop_Constraint.constant = 10 } else if self!.theDevice.isPhone { self?.segControlTop_Constraint.constant = 30 } } case .deferred: break @unknown default: if let error = transaction.error { let errorDescription = error.localizedDescription print("Transaction failed due to error: \(errorDescription)") } break } } } // Sets the purchase to true in the Db class IAPHandler: NSObject { //Get the ProVersion Status static func isProVersionPurchased() -> Bool { let VC_String = "IAPHandler" var theStatus = false do { let settings = try Database.shared.databaseConnection!.read { db in try My_Settings.fetchOne(db) } let theStatusText = settings?.ProVersion ?? "false" theStatus = theStatusText == "true" ? true : false } catch { print("Getting the ProVersion Status failed! \(VC_String) \(error)") } return theStatus } // Set ProVersion to true. static func setProVersionToPurchased() { let VC_String = "IAPHandler" do { try Database.shared.databaseConnection!.write { db in try db.execute(sql: "UPDATE My_Settings SET ProVersion = :proVersion WHERE Settings_ID = :id", arguments: ["proVersion": "true", "id": 1]) } } catch { print("Update set pro version, failed! \(VC_String)s \(error)") } } }// End of class
1
0
337
Jan ’25
How do I finish and track Consumable IAPs with StoreKit 2?
Hi, I'm attempting to use StoreKit 2 and SwiftUI to add a tip jar to my iOS app. I've successfully added consumable IAPs for each of my tip sizes, and used ProductView to show these on my tip jar screen. However, I am at a loss on how to do the following things: How and when do I finish the consumable IAP transaction? I see the finish() function in the documentation, but I am not sure how I can call it given that ProductView is handling the purchase for me (I have no access to a Transaction object). How can I track the amount of consumable IAPs the user has purchased across all their devices? I want to show the user the amount of money they have tipped in total. I have added SKIncludeConsumableInAppPurchaseHistory to my Info.plist and set it to YES as suggested here: https://forums.developer.apple.com/forums/thread/687199 This is my first time using StoreKit 2 (until now, I was using StoreKit 1), so I would really appreciate any advice and guidance you can provide. Thanks!
0
1
248
Jan ’25
Impossible to proper test subscriptions in Testflight - time for Action @Apple
I'm not sure how we reached the point where we accepted the current situation of subscription testing in Testflight as the normal. It has been drama for years now. It's also super confusing and many people don't understand why/what is happening. Let me write down first what is happening, after that all the issues and potential solution will be clear. Production app Uses live appstore backend + your apple id that is signed in on the device Testflight app Uses sandbox appstore backend + your apple id that is signed in on the device Local / Xcode Uses sandbox appstore backend + your sandbox apple id if correctly set on your device (settings / appstore / sandbox account). The problem is you can only manage the following subscriptions Live appstore backend + live apple id Sandbox appstore backend + sandbox apple id We are missing the option to manage Sandbox appstore backend + live apple id -> the situation we deal with in testflight. So there is no way to manage your testflight subscriptions. Few potential solutions that apple should implement: We need an option within the Testflight app to Manage subscriptions, that should than open the live apple id on the sandbox backend. Or give developers the option to use the sandbox account for testflight as well, not only for developing locally. To test in testflight you basically have to wait for the subscription to expire, but they also recently changed the renewal rates. It used to be 5 minutes for a month, now its 1 day for a month, so you have to wait 12 days before your monthly sub on testflight is gone. So we cant manage testflight obtained subscriptions, we cant use API's to manage them, we cant change settings like renewal rates, they are totally useless. This is really not usable at all. The situation has been like this for years, and all of us seem to accept this as normal. But this is a horrible developer experience, and we have to launch apps in production that we can't even test properly, only locally (so we can't let our testers test). How is this acceptable @Apple?
0
6
567
Jan ’25
Promotional Offers not Working-"Offer Not Available"
When attempting to use apple promotional offers for subscriptions I consistently receive the popup that says "Offer Not Available" for both production and sandbox. Without offer code purchase working fine. I have verified the App Store Connect setup and client side code and even created new offer codes also, but I have hit a dead end. Error:- (Error Domain=SKErrorDomain Code=18 "(null)" UserInfo={NSUnderlyingError=0x280dbb0f0 {Error Domain=ASDServerErrorDomain Code=3904 "Offer Not Available" UserInfo={NSLocalizedFailureReason=Offer Not Available}}})
2
2
411
Jan ’25
Disappearing External link account entitlement
I've got a Flutter app that is a “reader” app. The External Link Account Entitlement has already been requested and granted. It is already added as an Additional Capability to the App ID. The com.apple.developer.storekit.external-link.account entitlement is already present in the .entitlements file. Also SKExternalLinkAccount key is added to the Info.plist file with the correct URL. ExternalLinkAccount.open() is invoked via a MethodChannel call handler and things work perfectly in debug mode. The modal appears as expected and opens the link in the external browser. Xcode archive is also sucessful and the entitlement seems to be in place when inspecting the app with: codesign -d --entitlements :- ./path/to/app But when trying to distribute the app via Xcode the entitlement disappears. Other entitlements are not affected by this issue, eg.: com.apple.developer.associated-domains for universal links. This happens with automatically managed singing and a manually selected provisioning profile as well. When inspecting the latter in Xcode the necessary capability and entitlement is included. But when distributing to App Store Connect the entitlement disappears with both recommended and custom settings. I ran flutter clean mulitple times. What am I missing here?
3
1
765
Jan ’25
"Trouble connecting consumable In-App Purchases (IAP) to App Store Connect"
I am developing an app with support for In-App Purchases (IAP) for consumable products using StoreKit. I have defined the products in ProductList.plist and Product.storekit, but I am unable to connect them correctly to App Store Connect. Here are the details: Products defined in ProductList.plist: Bolet Evento Vip: com.cover.boleto.vip Boleto Evento Básico: com.cover.boleto.basico Configuration in Product.storekit: The products have prices and basic configurations, but they do not seem to link properly in App Store Connect. Steps I have taken: Configured IAP simulation in Xcode. Attempted to register the products in App Store Connect. Issues I am facing: The products are not appearing in App Store Connect after configuration. My app cannot seem to fetch consumable products from App Store Connect. Question: What steps should I follow to correctly register consumable products in App Store Connect and connect the app with StoreKit for production? Any advice or guidance would be greatly appreciated. Thank you!
0
1
351
Dec ’24
Can users create their own subscription plans?
I'm considering developing an app where users can create their own subscription plans by freely setting their prices, similar to YouTube's membership feature. I understand that in-app purchases must be used to unlock features within the app. With that in mind, I searched for APIs to enable this functionality but couldn't find relevant information. When I contacted Apple directly, they mentioned that they couldn't provide specific answers unless the app is under review. If anyone has knowledge about the following points, I would greatly appreciate your response: Is it possible to implement a feature similar to YouTube's membership using in-app purchase APIs? If it's not feasible with in-app purchases, is it allowed to use external payment services like Stripe?
0
0
292
Dec ’24
StoreKitSubscriptionView presents an unfriendly message when network is unavailable
I have a rather simple StoreKitSubscriptionView for my app's single subscription. Question: Am I expected to write code to handle lack of network connectivity? When I run the app on development device, not using the local StoreKit configuration but rather the real app store, if the network is not available I get a not-user-friendly error message instead of the normal SubscriptionStoreView content. I'm uncertain if end-users actually see this. Maybe they see a more appropriate "Cannot connect to App Store, try later" message? Maybe I am supposed to check for network and not present the view if it is not available. I don't recall any mention of this in the WWDC video but I guess I should check again. Ideas anyone?
1
0
385
Dec ’24
App Review - nothing is happening when tapping purchase button
I am trying to upload my app to the app store, but app review says that nothing is happening when they click my "purchase" button for my subscription paywall. I have tested my subscription button process on my local device numerous times, with a sandbox account and never a problem. For context, I am using revenuecat to process my payments here. Any advice on testing IAP's, edge cases that could cause this problem, or anything that could help me solve this? Thank you!
1
0
384
Dec ’24
Introductory offer is not seen on system bottom sheet with Subscribe button.
I have a yearly_subscription subscription in my App Store Connect. I have added an introductory offer for this product - pay up front 6 month for different price. When I fetch products with try await Product.products(for: Set(identifiers)) I receive this product and introductory offer is present there. When I test with StoreKit Configuration and launch buy flow and system bottom sheet with Subscribe button is shown, I can see 6 month for different price offer there. However on TestFlight and on production system bottom sheet with Subscribe button does not contain this introductory offer. product.subscription.isEligibleForIntroOffer returns true. Also, if I set length of Introductory offer to 1 year, everything works correctly. What can be the reason for 6 month Introductory Offer not being shown on system bottom sheet?
0
0
378
Dec ’24
StoreKit Configuration Not Syncing to Xcode
Hello! I am attempting to add Subscriptions to an App that Is already published on the App Store. I cannot get Xcode to actually sync what is in my App Store Connect. When adding the Storekit configuration file, I go through the automatic linking process and select the proper bundleID. The configuration file says 'Synced @ [CurrentTime]' however there are no subscriptions listed in there. I have attempted deleting the file several times, creating a new subscription group. With no success. Do I need to publish the subscriptions without the features first? Upon attempting to write the supporting code that will enable these features within the app, I cannot get Xcode to identify that I have these subscriptions. I have also tried pushing these to TestFlight, still with no success. Thank you.
13
5
1.4k
2w
Gift Subscription and Split Payment
I am the Lead iOS Developer for The Incc, an upcoming social networking application. The platform offers subscriptions that grant users access to premium content, primarily digital magazines showcasing diverse cultures, alongside standard social media features and additional unique functionalities. I am exploring two specific use cases for our subscription model. Promo Codes with Split Payments: We plan to collaborate with the our influencers (referred to as Mover Shakers) by providing them with promo codes for users to purchase subscriptions. For such purchases, we aim to implement a revenue split model, allocating 10% to the influencer and the remainder to us after Apple’s fees. Gifting Subscriptions: We also wish to enable users to gift subscriptions to others within the app. I understand that the Apple Subscription Service does not natively support these features. What other options do we have to achieve this that are also not against the Apple's guidelines.
0
0
303
Dec ’24
Is original_transaction_id and transaction_id globally unique?
Hello, Apple App Store Server API Team! I have one questions about the identifiers provided by Apple App Store Server API. Could you please answer? We are running an iOS App. In our app, the transactionId we get from Apple App Store Server API is called T1. (Example) Q1. Is it correct that other iOS apps cannot get T1 for transactionId from Apple App Store Server API? (I'm wondering if the transactionId is globally unique across apps.) Thank you!
0
0
405
Dec ’24
StoreKit 2.0 keep throwing unknown error.
After the release of StoreKit 2.0, the in-app purchase failure rate increased by 63.19%, with the majority of errors being StoreKitError.unknown. When encountering this error, many users repeatedly attempt to make a purchase, but the outcome remains unchanged, resulting in the same unknown error. In some cases, users who wait approximately 2 minutes before retrying the purchase may either succeed or encounter the following error: “StoreKit.StoreKitError.systemError(Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.storekitd”)”. This issue has directly impacted our app's purchasing flow. Because our app only displays the promotional purchase offer once, these issues have significantly reduced the number of users successfully completing the offer. As a result, the conversion rate for this promotion has dropped well below expectations, negatively impacting our business metrics.
4
1
1.6k
Feb ’25