1

I am attempting to extract the user's receipt to ascertain what their original purchase version was by using the following code:

if attr_type == 19 {
                // Bundle version
                var str_ptr = ptr
                var str_type: Int32 = 0
                var str_length = 0
                var str_xclass: Int32 = 0
                ASN1_get_object(&str_ptr, &str_length, &str_type, &str_xclass, seq_end - str_ptr)

                if str_type == V_ASN1_UTF8STRING {
                    originalPurchaseVersion = NSString(bytes: str_ptr, length: str_length, encoding: NSUTF8StringEncoding)

                securityInfo.originalPurchaseDate = originalPurchaseVersion as! String                        
                }

However, I set up a testflight beta programme and the user that is testing has previously purchased version 1.32, however, the returned value is always version 1.0.

jww
  • 97,681
  • 90
  • 411
  • 885
Tom
  • 790
  • 2
  • 9
  • 32
  • I can't answer the direct question, but it might be found in Apple's [Receipt Validation Programming Guide](http://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Introduction.html). – jww Aug 09 '16 at 22:04
  • From what I can find online. It appears that when testing using TestFlight or sandbox environment the result always seems to be 1.0 until switching to a production environment. I'd like to hear from others that have recently come up against this issue and possible solutions – Tom Aug 09 '16 at 22:07
  • *"I'd like to hear from others that have recently come up against this issue..."* - there should be no problems. Hopefully other iOS developers have already encountered it. I thought [Test Flight](http://www.macworld.com/article/2875441/apple-will-shut-down-original-testflight-beta-testing-platform-in-february.html) was shut down. – jww Aug 09 '16 at 22:21

0 Answers0