tikhop / TPInAppReceipt

Reading and Validating In App Purchase Receipt Locally.
MIT License
631 stars 93 forks source link

`originalAppVersion` returns build number on iOS and major and minor version number on macOS #114

Closed DePasqualeOrg closed 7 months ago

DePasqualeOrg commented 8 months ago

Expected Behavior

The value should be consistent on both platforms.

Steps to Reproduce (for bugs)

let receipt = try InAppReceipt.localReceipt()
let originalBuildVersion = receipt.originalAppVersion // Returns "28" on iOS and "1.28" in native macOS app
tikhop commented 7 months ago

Hello @DePasqualeOrg, thank you for bringing this up. Unfortunately, it's a feature, not a bug.

According to the documentation:

Original Application Version The version of the app that was originally purchased.

ASN.1 Field Type 19

ASN.1 Field Value UTF8STRING

JSON Field Name original_application_version

JSON Field Value string

This corresponds to the value of CFBundleVersion (in iOS) or CFBundleShortVersionString (in macOS) in the Info.plist file when the purchase was originally made.

In the sandbox environment, the value of this field is always “1.0”.

Please let me know if you have any further questions. Thank you!