I implemented keyboard navigation in my iOS app. Now I'm wondering what the best shortcut might be for a "Cancel" button/action. On the Mac, I'd assume ESC is a good choice but the iPad Smart Keyboard doesn't even have that key.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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)
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!)
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?
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?
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).
My CoreSpotlight extension seems to exceed the 6 MB memory limit. What’s the best way to debug this?
I've tried to attach the debugger on the Simulator but the extension seems to be never launched when I trigger the reindex from Developer settings. Is this supposed to work?
On device, I am able to attach the debugger. However, I can neither transfer the debug session to Instruments, nor display the memory graph. So I've no idea how the memory is used.
Any recommendations how to move forward? Is there a way to temporarily disable the memory limit since even with LLDB attached, the extension is killed.
I'd like to display a list of items to disambiguate for a fulltext search intent. Using the Apple AppIntentsSampleApp, I added TrailSearch.swift:
import AppIntents
@AssistantIntent(schema: .system.search)
struct TrailSearch: AppIntent {
static let title: LocalizedStringResource = "Search Trail"
static let description = IntentDescription("Search trail by name.",
categoryName: "Discover",
resultValueName: "Trail")
@Parameter(title: "Trail")
var criteria: StringSearchCriteria
func perform() async throws -> some IntentResult & ReturnsValue<TrailEntity> {
if criteria.term.isEmpty {
throw $criteria.needsValueError(IntentDialog("need value"))
}
let trails = TrailDataManager.shared.trails { trail in
trail.name.contains(criteria.term)
}
if trails.count > 1 {
throw $criteria.needsDisambiguationError(among: trails.map { StringSearchCriteria(term: $0.name) })
} else if let firstTrail = trails.first {
return .result(value: TrailEntity(trail: firstTrail))
}
throw $criteria.needsValueError(IntentDialog("Nothing found"))
}
}
Now when I type "trail" which matches several trails and thus lets us enter the disambiguation code path, the Shortcut app just displays the dialog title but no disambiguation items to pick from.
Is this by design or a bug?
(filed as FB17412220)
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags:
Siri and Voice
Shortcuts
Intents
App Intents