Manage in-app purchases on your server

RSS for tag

Discuss the WWDC21 session Manage in-app purchases on your server.

View Session

Posts under wwdc21-10174 tag

16 Posts
Sort by:
Post not yet marked as solved
0 Replies
138 Views
Use StoreKit 2 my client IAP code like this: func purchase(_ product: Product) async throws -> Transaction? {         let orderId = UUID.init()         let result = try await product.purchase(options: [.appAccountToken(orderId)])         switch result {         case .success(let verification) :             let transaction = try checkVerified(verification) //Here can I tell my server deliver content to user? //I do not want valid transaction on device(just like valid receipt via S2S use Storekit1)             return transaction         case .userCancelled, .pending:             return nil         default:             return nil         }     } If verificationResult return ..verified() case , can I tell my server deliver content to my customer ? Or should I send originalID for this transaction to my server, my server has to fetch transaction info by history Api(decode JWS info) to decide whether to deliver content to my custom? Thank you very much
Posted
by
Post not yet marked as solved
1 Replies
238 Views
Is there any real example of app store signed transaction or signed notification? I can find decoded form for transaction info or notification payload but not real signed example. There are some decoded examples - https://qonversion.io/blog/apples-2021-updates-to-managing-in-app-purchases-from-the-server but I want some real token with header alg and x5c. I would like test my backend implementation during development. My goal is receive App Store Server Notifications v2 and update my data.
Posted
by
Post not yet marked as solved
3 Replies
454 Views
Hello, we are currently testing non-renewing subscriptions purchase in new sandbox environment. We would like to receive server notifications but for v2 we only receive notification for auto-renewing subscriptions. Are notifications for other types of purchases also availible ?
Posted
by
Post marked as solved
1 Replies
501 Views
After watching all related WWDC content on auto-renewing subscriptions, including the most recent 2021 session titled "Manage IAP On Your Server," it's still unclear what actions are required for developers when an auto-renewing subscription is initially purchased using Store Kit 1 + Server Notifications v2. From "Manage IAP On Your Server" around 21:30 a diagram of the initial subscription flow is shown: What is most unclear to me is: Is it necessary to retrieve the receipt data from the device and send it to the application server (to then be sent to Apple's server to verify and get the decoded data) if the App Store server is going to be sending a SUBSCRIBED + INITIAL_BUY notification around the same time to the application server anyway? If it is still necessary to verify the receipt data from the local device, then what purpose does the SUBSCRIBED + INITIAL_BUY notification serve? What should the application server do when this notification is received if the subscription status has already been updated based on the receipt data? It seems that the recommendation from Apple is to verify the receipt data from the device to obtain the original_transaction_id and then use this value to relate future server notifications received for this id. Looking at the JWSTransactionDecodedPayload, it includes a field called appAccountToken however, it appears as though this can only be utilized with the iOS15+ StoreKit2 API. It would be greatly appreciated if someone could clarify the required steps for managing an initial purchase on both the client and server for: StoreKit 1 + Server Notifications v2 StoreKit 2 + Server Notifications v2 (I would love to start with StoreKit 2; however, I don't think it is feasible to limit purchases to iOS15+ at this time, given the large # of users still using older versions of iOS.) Thank you!
Posted
by
Post not yet marked as solved
1 Replies
312 Views
Hello all, Our app's product is a time based limited duration offering and we want to offer a monthly subscription for 4 months or an up-front payment for the 4 months. The up-front payment is easy to add (thinking non-renewing subscription) but I can't seem to automatically cancel a renewing subscription after 4 months of the user paying. In general hoping for a some way to set a schedule to end or stop the subscription or if we can cancel subscriptions after the 4 months by making calls to an API or something. Alternatively, some sort of 4 month long financing/pay over the course of 4 months would work similarly.
Posted
by
Post not yet marked as solved
1 Replies
445 Views
Hi, My app is Business to Business to Consumer (B2B2C) application where our customers are other businesses who deal with end users. Each of our customers can create subscription products of any value and assign features available to their users on subscription purchase. Is there a way to achieve this? How do i create dynamic subscription products and have them available on app instantly? I might be wrong, but from my reading i have learned that all in app products needs to be created on AppStore page and submitted for review. Please correct me if i am wrong in this. An example of what i am trying to achive with my app is, lets say i have 3 business clients Business A Business B Business C Each of them get a sub community on my app where they can invite users to become part of their sub community. Lets say Business A, B & C each of them have 100 users. 1 user can be part of unlimited sub communities. Now using the app and our website these business want to create subscription products for their users and give them access to exclusive content Business A - Subscription worth $5/month Business B - Subscription worth $10/month Business C - Subscription worth $50/year I want these subscriptions to be created and available instantly as created and not wanting to submit my app for review each time. Any suggestion and help is welcome. Can Apple Pay be used to make this work? Instead of using In App Purchase.
Posted
by
Post not yet marked as solved
1 Replies
387 Views
After subscription purchase, We plan to do JWS signature validation on the server-side instead of decoding the JWS in the IOS app. Currently, after purchase, I am getting the decoded details instead of the JWS in response. Could you please let me know which methods give the JWS after the subscription purchase inside the IOS app? Method's I am calling the inside the APP Product.purchase() ->given the purchase result. After purchase, we get the transaction object as a response Transaction.finish() //concluding the transaction Fetch the purchase information of the product transaction.currentEntitlement Sample response after the purchase was made. But we required the JWS instead of the below-decoded data. ({  "header" : {   "alg" : "ES256",   "x5c" : [    "**********",    "***********",    "*****************"   ]  },  "payload" : {   "bundleId" : "com.*******",   "deviceVerification" : "",   "deviceVerificationNonce" : "",   "expiresDate" : 1640100970000,   "inAppOwnershipType" : "PURCHASED",   "originalPurchaseDate" : 1631601452000,   "originalTransactionId" : "1000000877135811",   "productId" : "com.e**********",   "purchaseDate" : 1640100670000,   "quantity" : 1,   "signedDate" : 1640100987198,   "subscriptionGroupIdentifier" : "*****",   "transactionId" : "1000000935313340",   "type" : "Auto-Renewable Subscription",   "webOrderLineItemId" : "************"  },  "signature" : "64 bytes (verified)" })
Posted
by
Post not yet marked as solved
2 Replies
459 Views
Hello I'm trying to implement the storekit api https://api.storekit.itunes.apple.com/inApps/v1/subscriptions/{originalTransactionId} there for the JWT token is there any way we can retrieve the JWS directly in the decoded format without having to use an external library to get the token or decode it back?
Posted
by
Post not yet marked as solved
0 Replies
239 Views
Background: We are developing an app that converts wearable activity/fitness scores into our own original points. We would like to include a feature in the app that allows users to exchange products using our points. So technically, our app users don't need to make any financial payments as they only use the points they have accumulated to exchange for products. Question: Is there any possibility that not using in-app purchase will cause inconvenience in the app review/approval process?
Posted
by
Post not yet marked as solved
1 Replies
476 Views
Hi, I'm implementing an auto renew subscription in my app. I tried to figure out how to validate and get notified about any changes in users subscription status, and I found so much ways to do it. What is the difference between those: a. /validateReceipt b. appstore API (for example inApps/v1/history/{originalTransactionId}) c. apple notifications service, with the webhook url in the appstore connect information. Do I need to use all of the above methods in order to make my auto renew subscriptions 100% hermetic?
Posted
by
Post not yet marked as solved
2 Replies
555 Views
our app integrates Apple Pay, and after the user pays successfully, our server obtains the original_transaction_id. after we get the original_transaction_id, we call. The https://api.storekit.itunes.apple.com/inapps/v1/history/ interface. 3.Url of request: https://api.storekit.itunes.apple.com/inapps/v1/history/30000931965136 4.The response result is: {"revision":"0","bundleId":"live.vshow.live.dfgsdb2","appAppleId":1552575331,"environment":"Production","hasMore":false,"signedTransactions":[]} 5.Why is the result of signedTransactions empty?
Posted
by
Post not yet marked as solved
0 Replies
383 Views
i am implementing app in which i have implemented consumable plan purchase but whenever I sent consumable plan receipt to verify receipt url it gives error, my concern is how can I verify if consumable plan is valid or not on server side??
Posted
by
Post not yet marked as solved
0 Replies
544 Views
We will soon be launching a gambling/gaming beta test in Virginia that will be IOS friendly. Although we do not yet have a license, we wont be integrating real money in the beta test. The currency in the beta test will only be play money that we will be using to prove the concept of our platform. Subsequently when that concept is proven, we will then get a license to incorporate real money and have third party payment processors. Judging from this synopsis, will we have any trouble getting approved by the apple app store?
Posted
by
Post not yet marked as solved
4 Replies
1.8k Views
In this session at 21:06, a new section for App Store Server Notification urls is shown with the new option to specify a Sandbox URL as well as a Production URL. Shortly after that point in the video it is mentioned that "these changes" are rolling out later this year. My question is whether "these changes" includes this new configuration option to specify a Sandbox URL. If so, can we get any more specific about when "later this year" is? If not, I'm not seeing those changes now, so when will they be rolled out?
Posted
by