Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't get the original_application_version from the App Store Receipt in iOS 7

I'm trying to implement a seamless transition from paid to freemium model for my current customers, but having problems getting the original_application_version from the receipt.

My app is iOS 7 only and, as you may know, Apple introduced the Unified Receipt in iOS 7, which, as stated, should contain information about the original purchase made by user. So my idea was the following: 1. Decode the receipt. 2. Check if the original purchase was made before this new freemium version. 3. If yes - unlock all IAPs.

As stated in the docs the receipt should have this "Original Application Version" field ("The version of the app that was originally purchased."). It's also said that "In the sandbox environment, the value of this field is always “1.0”." But for some reason this is not the case for me.

So, my question is: did someone had any luck getting this value?

I tried to use DHAppleReceiptParser (https://github.com/DarkHorseComics/DHAppleReceiptParser) and RMStore (https://github.com/robotmedia/RMStore) to parse the receipt, both are giving me empty value for this field. I'm also looking for this value in ASN.1 Field Type 19, maybe there is another field I can use for my purpose?

like image 839
uson1x Avatar asked Dec 17 '13 08:12

uson1x


2 Answers

It might be a sandbox quirk related to the iTunes/Apple account, specially if it happens with various libraries. I would also try with https://github.com/rmaddy/VerifyStoreReceiptiOS, to be extra safe.

Signing off from Settings might also help.

Also, test the production case. Install the current version from the App Store, then install the new version over it and see if the original_application_version field is still nil.

like image 66
hpique Avatar answered Nov 11 '22 22:11

hpique


Looks like I duplicated this question myself (Using RMStore library to get originalAppVersion). I checked to see what the itunes server validation would return. The interesting result was that there was NO FIELD named "original_application_version" coming back from the apple server, but there WAS A FIELD named "original_purchase_date". Maybe the date is more reliable than the version number...

like image 26
JohnnyC Avatar answered Nov 11 '22 22:11

JohnnyC