StoreKit

RSS for tag

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

StoreKit Documentation

Post

Replies

Boosts

Views

Activity

Price Locale not available in Product
In the latest Product object we are unable to get the price locale of the current product. Even though the display price string available with currency symbol, we need to display discount price of current product by comparing with other products. Earlier in SKProduct we had price locale property to achieve this.But in latest Product object we are missing this. Is there a way to get the price locale of the current storefront?. There is a countryCode property in Storefront enum. But there is no option to create locale using country code.
3
0
3.5k
Aug ’21
Is subscription autoRenewStatus in StoreKit2 working correctly with Sandbox testing?
It seems that subscription status gives different results with XCode testing and Sandbox testing. I am using StoreKit2 to implement an IAP of an autorenewable subscription. I want to determine whether the subscription has been cancelled, so that the UI reflects that the subscription will stop after the expiry date and not be renewed. the 'willAutoRenew' property of the subscription status renewalInfo seems to do exactly what is required, and works fine in XCode testing. My setup is very similar to the StoreKit demo associated with the WWDC21 session available here: https://developer.apple.com/documentation/storekit/in-app_purchase/implementing_a_store_in_your_app_using_the_storekit_api/ To demonstrate its use, add: print(renewalInfo.willAutoRenew) after line 79 of the SubscriptionsView in the demo project. When you run the app, and purchase a Standard Navigation assistance subscription, the console shows 'true'. If you then cancel the subscription in XCode (Debug:StoreKit:Manage Transactions), the console will show 'false' as expected So far so good. My problem is that when I move to Sandbox testing, and cancel the subscription in another way (eg using the .manageSubscriptionsSheet view modifier, or in Settings:App Store:Sandbox Account), the willAutoRenew property remains true, even though the subscription is in fact cancelled (ie it disappears after the expiry date) Does anyone know a workaround to determine cancellation status?
5
0
3.6k
Sep ’21
TestFlight App uses wrong sandbox account for payment
I'm using TestFlight to test an app with payment/subscription functionality. I created sandbox accounts in AppStore Connect accordingly to be able to test the subscriptions. I'm logged in with the sandbox account. When I try to subscribe in the App the wrong account (this is my actual real AppleID) is used for the subscription although it is recognized that this is just a sandbox subscription. I tried: logging off/on into the sandbox account creating a totally new sandbox account trying to trigger the payment with no logged in sandbox account The result is always: in the payment popup it is stated that the purchase account will be my original AppleID and not a sandbox account. How can I switch the accounts? Is this a bug at Apple's side somehow?
17
11
16k
Oct ’21
Which key to use to validate the Server-Side Notifications v2 JWTs?
I am looking at using the v2 in-app subscriptions server-side notifications. I have got this working by decoding and validating the token using the x5c and alg properties in the header. However, I don't know how to validate that this certificate was issued by Apple. The docs don't really seem to say anything about this. Does anyone know how I do this? At the moment, my code is a bit pointless as the jwt could have been signed by anyone. The only other thing I can think of is to ignore the JWT altogether and just use the API to query every time which seems to defeat the object.
3
1
3.3k
Nov ’21
The bank identification code you selected does not match the corresponding part of your IBAN.
I'm stuck in "Add bank account" step when filling User informations in Agreements, Tax, and Banking for Paid Apps. When I try to save, i get the error The bank identification code you selected does not match the corresponding part of your IBAN. I checked many times, all of my informations are valid (Valid IBAN, Account number same as given by my bank). I even tried to take every part of my IBAN as account number because I was desperate, nothing changed. I'm with Qonto bank. What am I doing wrong ?
2
1
2.1k
Nov ’21
Apple immediate trial cancellation
When I subscribe for a trial period in Apple products like: Apple Music Apple TV Apple News etc. If I want to cancel my subscription via App Store I see a message: If you cancel, you will immediately lose access to Apple Music and the remainder of your free trial. Нou cannot reactivate this trial At the same time for 3d party developers when a user clicks Cancel Free Trial alert says: If you end your trial now, you will still have access to it until some date So my question is how can I replicate the same logic for my app. I've googled a lot but didn't find anything. I believe it should be possible to do since Apple apps are just like any other app distributed via App Store. If not - it looks like unfair competition because users will more likely postpone trial cancellation for Apple products and forget about this which will result in charging their money.
3
3
2.0k
Nov ’21
How to hide an auto-renewal subscription from App Store manage subscriptions page
I've created 2 auto-renewing products, one with a cheaper price and one with a more expensive price. I show the cheaper product for legacy users (users who have been on the app for a long time). The problem here is that when a user goes to the App Store and manages their subscription there, they are able to see the cheaper option and subscribe to it. Is there a way I can hide the cheaper product from being purchased through the App Store and only allow them to be purchased from my app? I saw the Cleared For Sale option on the product but when I tried unchecking the box, it made it sound like after users' subscription ends, they will no longer continue auto-subscribing to the cheaper option. Or am I misunderstanding Cleared For Sale?
3
1
2.7k
Jan ’22
Is transactionId unique?
I want to track subscriptions of multiple applications and need to choose unique key. Can transactionId from app1 match somehow transactionId from app2? If yes, then Is it possible situation: app1 and app2 have products with same productId (e.g. "com.subscription") and have transactions with same transactionId? So should I use key (appAppleId, productId, transactionId)? (It would be more convinient to use transactionId, but I am not sure about uniqueness)
2
0
1.1k
Jan ’22
StoreKit2 verification fail after app update
Hello, I have a production issue with StoreKit2. My app has a renewal subscription, people can subscribe and get their benefits. The issue occurs when I release a new version of the app, as soon as subscribed people install the update they loose their benefits because the transaction is detected as unverified by storeKit2. If they delete the app and reinstall everything works properly again until the next app update. It hard to debug because it happens only in production. It is very frustrating and I have no idea how to solve this issue. The only solution I have though of is to remove the transaction verification. Thanks for your help, Cédric
2
0
991
Feb ’22
SKAdNetwork: Error while updating conversion value
Hello! I make use of the new iOS 15.4 SKAdNetwork.updatePostbackConversionValue feature: SKAdNetwork.updatePostbackConversionValue(0) { error in                 if let error = error {                     print(error.localizedDescription)                 }             } I am not sure why, but I always see this error message in the console: SKAdNetwork: Error while updating conversion value: Error Domain=SKANErrorDomain Code=10 "(null)" The operation couldn’t be completed. (SKANErrorDomain error 10.) Any idea what’s going on there? What does Error Code 10 mean? Couldn't find anything in the documentation about that so far. I have the NSAdvertisingAttributionReportEndpoint key with domain (https://api2.branch.io/v1/skadnetwork/advertiser_app) in my .plist.
5
0
4.8k
Feb ’22
Offer codes for non-renewing subscriptions?
Hello, At https://developer.apple.com/documentation/storekit/skpaymentqueue/3566726-presentcoderedemptionsheet Apple describes a way to enables users to redeem subscription offer codes. Unfortunately according to https://help.apple.com/app-store-connect/#/dev6a098e4b1 this only seems to relate to auto-renewable subscriptions. Is that right? Is there also a way to offer codes for non-renewing subscriptions? Thank you so much!
2
0
1.3k
Feb ’22
Can an App detect a subscription's cancellation in itself?
StoreKit2 provide great API AppStore.showManageSubscription(in:) to downgrade, upgrade or cancel the user's subscription, however, can the App detect the cancellation in App? (without server to server notification) I understand the upgrade and downgrade can be detected in Transaction.updates, but I'm not sure about the cancellation. I want to update my label's text from Next billing date: \(date) to Expires \(date) if the user cancels the subscription in showManageSubscription(in:) sheet. Can I implement that?
3
0
1.1k
Mar ’22
StoreKit 2 isEligibleForIntroOffer
Hello all, Created and tested successfully auto renewal subscription products in my app. Both products offer 7 days free trial. Once purchased for the first time, isEligibleForIntroOffer value was true and when I tried to subscribe again later, the value is false - everything worked as expected. However, when I reset the eligibility for my sandbox user through the edit subscription screen, I do see that the Free Trial offering becomes available again, as expected, but when I test it in the app, the value for isEligibleForIntroOffer is still false. The value is false for the group (Product.SubscriptionInfo.isEligibleForIntroOffer(for: renewableSubscription.subscriptionGroupID)) and also for the product (renewableSubscription.isEligibleForIntroOffer). iOS 15.4. Is this a bug? Can I still trust this property value as the only source to check whether the user is eligible for intro in production? Thanks a lot.
3
2
2.1k
Jun ’22
Redeeming code stucks very often after pressing "Redeem offer code"
Hello, we are facing an issue, that the Code Redemption Sheet is not continuing correctly. Sometimes its just disabling the "Redeem" button and nothing happens for a while. After a while the button gets enabled again and you can press the button again. Sometimes its working then, sometimes not. Furthermore after the button action works and the payment method was chosen, the same issue can happen again. Its doing nothing for a while and you have to start again. The app has the target SDK iOS 14 and uses SwiftUI. We just display the Code Redemption Sheet by using this snippet: SKPaymentQueue.default().presentCodeRedemptionSheet() The screenshot show the "stuck" behavior. The button is disabled and nothing is happening for a while. The code itself is fine and it is working. Best regards, Sebastian
31
17
7.7k
Jun ’22
Where can I get used Offer Codes from?
I would like to programmatically keep track of offer codes that have been used. I just configured a Test Offer Code (Reference name), which contains 500 codes (Offer Codes) to buy a 1-month subscription for 0,49€. I was able to redeem the code and everything works, but I was expecting to receive the used code. Instead I received the Reference name in the payload from the App Store Server Notification in the field offer_code_ref_name="Test Offer Code". (expected was sth like offer_code_ref_name="JFFDS61SBJDBJ5BXJS4BX") I would be able to identify the Reference name by the code, if it was provided, because I have the following table in my app's backend: reference_name | code | url | expires_at | used | reserved Test Offer Code | xadz | zzz | 31-07-2022 | t | f Test Offer Code | asdf | *** | 31-07-2022 | f | f The used code doesn't seem to be included in the latest receipt. How can I obtain it? Can I somehow call App Store Connect API? Thanks
5
0
2k
Jul ’22
Not receiving Refund notification from app store server api
Hi, I am creating an app which provides in-app purchases to users, currently I am in testing phase of the purchase functionality and facing an issue regarding refunds. On upgrading a product that I am subscribed to (all products are auto-renewable subscriptions), I am receiving the UPGRADE notification type but I haven't yet received a REFUND notification type as the documentation suggests. I am using app store server-to-server Notifications 2.0+ with node.js as backend, I am receiving all the types of notifications just not the REFUND notification type.
4
0
859
Jul ’22
Affiliate Platforms for iOS apps?
I want pay commissions to partners that promote our apps. So if they write a review on their website and a user clicks on the link to the App Store and buys a subscription, I want to know that it originated so I can pay them the commission. Are there any Affiliate Marketing Platforms that support App Store sales? Is this even possible to track the origin of a sale through the App Store? Is there another way to track sales originating from promotion partners?
4
2
3.1k
Aug ’22