-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose original_purchase_date #191
Conversation
Hi! 👋 Thanks for posting the PR. I'm a bit confused about it, though:
Did you mean See It's supposed to correspond to |
Hi @aboedo , Yes, CFBundleVersion is exactly the problem. For all of my builds I use "1" as a value and increment that only if necessary. So my releases look like:
The right thing to be exposed (from Apple) would be CFBundleShortVersionString but since this is not exposed, for my case (and I guess also for others) I have to resort to originalPurchaseDate. |
Ohh, I see, thanks for clarifying. Yeah, this will be a problem for developers who don't have distinct build numbers for all releases. |
@@ -34,7 +34,7 @@ NS_SWIFT_NAME(Purchases.PurchaserInfo) | |||
@property (readonly) NSSet<NSString *> *nonConsumablePurchases; | |||
|
|||
/** | |||
Returns the version number for the version of the application when the user bought the app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be confusing for some developers, since it will be the marketing version number on Mac, and the build version number on iOS.
from the docs:
This corresponds to the value of CFBundleVersion (in iOS) or CFBundleShortVersionString (in macOS) in the Info.plist file when the purchase was originally made.
See "Original Application Version" in (https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html)
maybe we could replace this line with:
Returns the value of CFBundleVersion (in iOS) or CFBundleShortVersionString (in macOS)
in the Info.plist file when the purchase was originally made.
See "Original Application Version" in
https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html
for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aboedo I updated it keeping the old pattern (before my PR) and using the human friendly and widely known names for those properties in the first row of the description. CFBundleVersion
while being the right technical term, it can easily be mistaken for the app version
and create confusion.
The new description is:
Returns the build number (in iOS) or the marketing version (in macOS) for the version of the application when the user bought the app.
This corresponds to the value of CFBundleVersion (in iOS) or CFBundleShortVersionString (in macOS) in the Info.plist file when the purchase was originally made.
Use this for grandfathering users when migrating to subscriptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes look good! thanks again for opening the PR! Hopefully it'll help other devs who run into the same issue
Please port this to Flutter when you get to 🙏🏻😻 |
will do! |
For many apps using the originalApplicationVersion is no good since it returns the build number instead of the version number. The scope of this PR is to:
Edit: Added tests
Edit 2: Fixed the naming mixup in the PR description