My project deploy target is iOS 11.2, I have an intent file for widget supports, which contains a custom type.
The project works with Xcode 13.2.1, when using Xcode 13.3 beta (13E5086k), the generated file contains an extra extension without available decorator, which cause a compile time error: 'IntentType' is only available in iOS 12.0 or newer
public extension IntentType {
override class var supportsSecureCoding: Bool { true }
}
Compile project using Xcode 13.2.1:
Compile project using Xcode 13.3:
I've composed a new feedback with a sample project:
FB9889772 (Xcode 13.3 failed to compile project deploy to iOS 11.0 with Intent definition contains custom types, error: 'IntentClass' is only available in iOS 12.0 or newer.)
Post not yet marked as solved
After upgrading to iOS 15 beta 4, several users report the app crashes shortly when launch.
Debug in the device, we had the same crash:
*** Terminating app due to uncaught exception 'CKException', reason: 'CKDataBaseOperations must be submitted to a CKDatabase'
The user info in this CKError leads us to this line:
// Called when app launches
final class PrivateDatabaseManager {
let container: CKContainer
let database: CKDatabase
public init(container: CKContainer) {
self.container = container
self.database = container.privateCloudDatabase
}
func resumeLongLivedOperationIfPossible() {
container.fetchAllLongLivedOperationIDs { [weak self]( opeIDs, error) in
guard let self = self, error == nil, let ids = opeIDs else { return }
for id in ids {
self.container.fetchLongLivedOperation(withID: id, completionHandler: { [weak self](ope, error) in
guard let self = self, error == nil else { return }
if let modifyOp = ope as? CKModifyRecordsOperation {
modifyOp.modifyRecordsCompletionBlock = { (_,_,_) in
print("Resume modify records success!")
}
self.container.add(modifyOp)
}
})
}
}
}
}
If we add a break point in this line, the properties in modifyOp look fine. and we don't have this issue before this beta.
Checking the crash data we collect in firebase, the operating system is 100% iOS 15.
Using:
Xcode: Version 13.0 beta 3 (13A5192j)
Device: 15.0 (19A5307g)
Post not yet marked as solved
Do I need to check Intent is eligible for Siri Suggestions before donate it with INInteraction? But I only want to donate this intent so Siri can add my widget to Smart Stack, not in Lock Screen or other places.
Intent Definition:
Intent is eligible for widgets
Intent is user-configurable in the Shortcuts app and Add to Siri
Intent is eligible for Siri Suggestions
Donate Intent:
let widgetIntent = MyWidgetConfigurationIntent()
widgetIntent.range = .weekly // Configure my intent
let interaction = INInteraction(intent: intent, response: nil)
interaction.donate { error in
if let error = error {
// Error: Code=1901 "Cannot donate interaction with intent that has no valid shortcut types"
}
}
My widget's layout is like:
/* Small */
HStack {
		BigItemA
		BigItemB
}
/* Medium */
VStack {
		HStack {
				BigItemA
				BigItemB
		}
		HStack {
				SmallItemA
				SmallItemB
				SmallItemC
		}
}
I want to configure this widget in this way:
/* Small */
BigItemA -> What?
BigItemB -> What?
/* Medium */
BigItemA -> What?
BigItemB -> What?
SmallItemA -> What?
SmallItemB -> What?
SmallItemC -> What?
So I add two parameters in my custom intent, and checked Supports multiple values and Fixed size.
For big items, everything is ok, I just set array size to be 2 at every widget size.
However, for the small items, when I make the array size to be 0 in small widget size, I get an alert: Array size must be a positive number.
How can I implement this requirement in intent definition?