Retrieve the subscription_group_id from an in-app purchase receipt - ios

Is it possible to retrieve the subscription_group_id from validating a local receipt? I'm am validating it via ASN.1 on device. Apple provides the following receipt fields on their website: https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1
However, I can't see anything about the subscription group id. Seems weird we wouldn't be able to access that so is there another way?

Related

How to verify ios In-App Purchase with different account?

I'm developing an app with non-consumable products. My app need to register and log in for service.
I figure out that the products that user has bought are tied with Apple ID. If user use same Apple ID but different accounts from my server, how will I verify them whether the account buy the product or not?
I have used original_transaction_id to validate it.
Steps-
When any user make a payment, validate the receipt on server.
If a valid payment then update paid in your database and store
original_transaction_id of that receipt.
Next time if the user use same Apple ID, after validating the receipt, check if the original_transaction_id exists in the database or not. If already
exists means user is using same Apple ID for other accounts too,
else its using its Apple ID to make payment first time.

How to verify subscription of user from developer account of iTunes?

I am facing one issue. I have integrated iOS in-app purchase plugin in my Cordova phone-gap app. In-app purchase plugin is working fine but sometimes due to some issues subscription will be paid but I am not able to get return response on server side because it will not hit my server side file where I have add API to fetch response but its subscription will be paid and user will receive receipt with order ID, Document Number.
Now the question is how do I verify from my iTunes developer account that user is subscribed or not. In my sales report I will get only subscriber ID field and not getting any order ID, receipt Number etc.
So is there any alternate way to verify user's subscription status?
Thanks

Is it possible to refresh the receipt of an in-app subscription from an iTunes API?

I have a backend api that accepts the receipt hash data from client ios devices when an iTunes subscription is purchased. I use https://buy.itunes.apple.com/verifyReceipt to verify the receipt data from Apple and to get the subscription details such as transaction id, expiration date etc.
It seems based on this post that I need to refresh such receipts to discover whether or not there is a cancellation_date. Other than doing this from an ios device as described in the developer docs, is there any other way to call an itunes endpoint from the server-side?
Send the receipt itself and have the server store it. Then, re-send the receipt from the server as often as needed to check for subscription updates.
Apple docs:
Persisting Using Your Own Server
Send a copy of the receipt to your server along with some kind of credentials or identifier so you can keep track of which receipts belong to a particular user. For example, let users identify themselves to your server with an email or user name, plus a password. Don’t use the identifierForVendor property of UIDevice—you can’t use it to identify and restore purchases made by the same user on a different device, because different devices have different values for this property.
The documentation for how to validate a receipt on the server side may be helpful here as well.

iOS inapp purchases receipt additional payload

In my application users can make purchases linked to their accounts in the system, not apple ID. As usual iOS app sends App Store receipt to server, which validates it. I want to know, that each transaction inside receipt belongs to specific user account. One way to do this, is sending additional parameters further to receipt like:
receipt: String, login: String, platform: String
Receipt digital signature validation make sure that the data inside is valid and not replaced by hacker. If parameters (login and platform) will be inside receipt, validation will be completely safe, and valid digital signature tells that all purchases are valid and belongs to account. Otherwise, one receipt can be sent with different logins and allows multiple users to have purchases without paying. To prevent this, for instance, all bundle (receipt, login, platform) can be additionally signed and added check for unique pairs transactionID, userId.
My question is there any way to put additional transaction parameters to receipt, or another common way to archive linkage between purchases in receipt and user account?

in-app Apple subscription...can't find information about the "Share your information" feature

Now that Apple has changed their in-app subscription model, there is a feature that allows a user to share their information when they confirm their subscription. The message below is displayed after a user confirms their subscription purchase:
"Share your information"
"The developer would like your name, email and zipcode so they can send you messages about related products in accordance with their privacy policy."
I have the Apple In-App purhcase programming Guide and I can't find anything about how this 'data' about the user is returned or retrieved by the developer. Is it returned in the JSON string when verifying a receipt?
Apparently, this information is not passed or shared with the app via the API or any delegates. Apple collects this data themselves with the user and shares it via a backend admin. No programming is necessary to handle this feature.

Resources