Post

Replies

Boosts

Views

Activity

OSLog in Swift macro doesn't persist original file/line number
I need to log to OSLog and into a file in parallel (due to OSLogStore not being able to provide old logs (FB13191608)). In Objective-C I can accomplish this with a macro using __FILE__ and __LINE__ in the macro implementation which still reference the position in the original code. I tried to create a Swift macro to make this work from Swift. However, log() takes the file and line number of the macro definition file instead of the position in the calling code. So when I click on the metadata link, I'm taken to the macro instead of the calling location. Is there any solution to that? #file and #line are correctly set in the macro but there’s no way to specify file and line number to the log() function (FB13204310).
5
0
1.3k
Sep ’23
Are App Intents supported on watchOS?
I'm trying to implement App Intents and App Shortcuts on watchOS. To do that, I included my AppIntent and my AppShortcutsProvider to the WatchKit extension target. The intent has one variable parameter: @Parameter(title: "Category", description: "Category", requestValueDialog: "What are you searching for?") var category: String However, when I speak the invocation phrase to Siri on the watch, Siri immediately responds there's something wrong. My perform() method isn't even called and there's nothing in the log. Is this supposed to work? How could I debug this? Is there a sample app showing App Intents on watchOS?
2
3
1.6k
Nov ’22
What does this UICollectionView exception mean?
In my application using UICollectionViewDiffableDataSource and compositional layout, I saw this exception Thread 1: "This solver does not handle estimated items so this method does nothing. Are you calling this in error?" that was thrown in dataSource.apply(snapshot, animatingDifferences: animated). I don't understand what it is telling me and how I should fix it. Any idea?
4
0
1.2k
Feb ’22
IAP Receipt for app bundles
We're validating app receipts and use the original_purchase_date and original_application_version to determine if the user is a legacy user and thus entitled to certain privileges. (We moved from paid to freemium and give legacy users free access to features now requiring a subscription.) Now we're wondering what values the above fields have if the user purchased an app bundle (consisting of two apps). Is the receipt for both apps the same? If yes, which bundle_id and which original_application_version is sent in the receipt? If not, how is original_application_version set? (According to the version of each app at purchase time?) How is original_purchase_date set? (According to the bundle purchase date? Or the first installation date of each app? – one of the apps could be installed much later!)
3
0
2.2k
Jul ’21
StoreKit testing: local dates are written as UTC dates in generated receipts
I use Xcode StoreKit Testing on the Simulator to test auto-renewable subscriptions. After a purchase, I parse the receipt. I noticed that purchaseDate, subscriptionExpirationDate (and cancellationDate if cancelled later) are all reported as UTC dates in the receipt even though they are local dates. So all dates are wrong by the offset of the local time zone towards UTC. I've verified with two independent ASN.1 receipt parsing libraries (https://github.com/nomad/venice and https://github.com/IdeasOnCanvas/AppReceiptValidator which has a nice Mac demo app) and even converted the purchase_date_ms/expires_date_ms/cancellation_date_ms that all confirm the 1h offset (I'm on CET which is UTC +1). I can't imagine doing anything wrong in my code since the receipt is generated by the StoreKit Testing system. Is this is known issue? (logged as FB8999149)
0
0
1.1k
Feb ’21