While reviewing the Apple Documentation, I came across a potential issue in one of the examples that I believe is worth addressing.
The example appears to compare strings instead of integers, which could lead to unexpected behavior in production environments. Specifically, in the line where originalMajorVersion (a string) is compared with newBusinessModelMajorVersion (also a string) using <:
if originalMajorVersion < newBusinessModelMajorVersion
This comparison performs a lexicographical check rather than evaluating the numerical values of the strings. As a result, strings like "10" would incorrectly be considered less than "2", which is not the desired behaviour when comparing version numbers.
I have reported this via the Feedback assistant (FB16432337) but at the time of posting this there has been no reply at all (23 days)
Supporting business model changes by using the app transaction
do {
// Get the appTransaction.
let shared = try await AppTransaction.shared
if case .verified(let appTransaction) = shared {
// Hard-code the major version number in which the app's business model changed.
let newBusinessModelMajorVersion = "2"
// Get the major version number of the version the customer originally purchased.
let versionComponents = appTransaction.originalAppVersion.split(separator: ".")
let originalMajorVersion = versionComponents[0]
if originalMajorVersion < newBusinessModelMajorVersion {
// This customer purchased the app before the business model changed.
// Deliver content that they're entitled to based on their app purchase.
}
else {
// This customer purchased the app after the business model changed.
}
}
}
catch {
// Handle errors.
}
Post
Replies
Boosts
Views
Activity
Hello everyone,
I hope you’re all doing well.
I wanted to check if anyone else has experienced unusual behavior with their financial reports. I’ve encountered this issue at least three times in the past six months, and I wanted to provide an example for clarity.
Initially, I receive an email stating that financial reports are available for the following regions:
• China
• Euro-Zone
• Hong Kong
• Hungary
• India
• Malaysia
• Norway
• Pakistan
• Rest of World
• Romania
• Saudi Arabia
• Sweden
• United Kingdom
Upon reviewing the report, the amount might show something like £116, which seems fine. However, a day or two later, I receive another email indicating reports are available for:
• Americas
• Australia
• Consolidated
• Detailed Consolidated
When I check again, the total amount has dropped significantly, for example, down to £75.
I’m confused as to why the amount would decrease when adding other territories should logically increase the total. Additionally, I’m concerned about potentially missing payments since this has occurred multiple times, though it wasn’t an issue in the past.
I might be overlooking something, but I’ve noticed a few other posts raising similar concerns without any clear resolution. If anyone could shed some light on why this happens or provide guidance, it would be greatly appreciated.
Thank you in advance for your help!
Hi there! I was wondering if there’s any possibility of using a SwiftUI View for a launch screen. As someone who’s primarily worked with SwiftUI, I have to admit that using Storyboards was a bit of a challenge for me—kudos to all you UIKit pros for mastering it! 😊
Thanks for considering it!
As someone who frequently uses Preview, it would be convenient to have the option to view the preview on another display. Are there any existing methods or plans to introduce a feature that allows us to pop out the previews to another screen?
Hello,
Just pushed a big update on my app and included new features using the consumable in app purchase. These have been in review for about 14 hours now, the problem since then is my app got approved and is out in the wild with the in app purchases not showing up on my store (probably because they are in review) they only one that shows up is a non consumable that was approved about a month ago.
Is there anything I should have done differently as these are consumable in app purchases as in testing and TestFlight they have all been working fine and if not how long can I expect them to be stuck in review for?
Im really stuck and need these in app purchases to be approved or rejected so I can get them working in the app.
Hi guys,
I am very new to this and was excited to add a simple dark mode in app purchase to my app. I have purchased it myself and at least 2 other friends to test it out (other than using sandbox) the purchases have gone through and it has unlocked the dark mode.
My question is that I have no stats for sales its been a few hours and im now worried that these purchases are not going to show up for me.
I originally just thought it would take about 24 hours for the reports to come through but I have read that after about 2-3 hours you should get stats refresh evry hour or so.
I have now pushed an update to Apple just with the In-App Purchases added to signing and capabilities in the hope that this will help fix any problems I may have caused myself.
If someone could help me put my mind at ease and tell me I haven't completely messed this up that would be great and also any help on reports would be great.