@KPsingh, you can read my answers in thread
https://developer.apple.com/forums/thread/681607
A summary:
In our case, when the user makes a purchase in the app, we send the
userID, and the original_transaction_id, the purchased product to a URL
in our backend server, and register that information in the database
(using the original transaction_id as the database primary key).
When we receive notifications, using the auto_renew_product_id and
the unified_receipt.pending_renewal_info we get the
original_transaction_id afected in the notification. That
original_transaction_id will be used to query the database, and get the
userID related to that purchase.
-
—
barrytheunissen
-
—
yevhen-zavhorodnii
Add a CommentIm trying to implement the back-end server part to receive in-app purchase notifications from the Apple App Store, but I'm not sure how to do it. My server is written with ASP.NET and my method signature looks like this (as a test):
[Route("api/AppStore/Apple")] public IHttpActionResult Apple(string data) { System.IO.File.WriteAllText("c:\\test\\apple.txt", data); // var appleRealTimeDeveloperNotification = JsonConvert.DeserializeObject<AppleRealTimeDeveloperNotification>(data); return Ok(); }And I wired up my endpoint in the Apple App store for my app to point to this, but nothing seems to come through. My server is running TLS 1.2 and https...
Any help would be appreciated!
Any update on it?
I wrote quite similar endpoint using C#
` [HttpPost] [Route("apple-notification")] public async Task ProcessAppleNotification() { using var streamReader = new StreamReader(Request.Body); var content = await streamReader.ReadToEndAsync(); _logger.LogDebug($"Got request from Apple: {content}");
return Json(new { requestBody = content }); }`And telemetry is showing me that there is no requests from AppStore has been even received