Nevermind
I just renamed the icon from AA_appIcon83.5@2x~iPad.png to AA_appIcon@3x~ipad.png and the error went away and the icon picker still works from within the app.
Post
Replies
Boosts
Views
Activity
I could never figure out yet why I can't fetch from The intent file, the fetch error catch bit gets called because I put a dummy entry in there that would display on an error. the app group share file approach I put in the comments is the best solution I've found so far, and just an update, after deleting the Derived Data file from the Mac the widget is working on the Mac now so I'm happy with that.
I have the same issue, I can not fetch from the IntentHandler.swift so in my App I created an array of values when the appp opens and closes that saves some values to an array in the app group,
let defaults = UserDefaults.init(suiteName: "group.my-app")!
defaults.setValue(CoreDataStack.createArrayOfContactsForWidget(), forKey: "ContactsForWidgetIntent")
static func createArrayOfContactsForWidget() - [String] {
var arrayOfContactIDsAndNames = [String] ()
let fetchRequest = NSFetchRequestUser()
let entity = User.entity()
fetchRequest.entity = entity
fetchRequest.predicate = NSPredicate(format: "isVisible = %@", "1")
do {
var users = try CoreDataStack.managedObjectContext!.fetch(fetchRequest)
users.sort(by: { $0.first_name $1.first_name })
for user in users {
//To get an array of currently added users
arrayOfContactIDsAndNames.append("\(user.contactID)|\(Helper.getUserFullName(user: user))")
}
} catch {print(error)}
return arrayOfContactIDsAndNames
}
Then in the intent I pull that contact ID and the name to display and it works fine on iPhone but not on Mac.
...
contactIDsArray = defaults.value(forKey: "ContactsForWidgetIntent") as! [String]
for user in contactIDsArray {
let values = user.components(separatedBy: "|")
let contactID = values[0]
let name = values[1]
let personIntentObject = Person(identifier: "\(contactID)", display: "\(name)")
userItems.append(personIntentObject)
}
completion(INObjectCollection(items: userItems), nil)
Not sure why but its working on iPhone. On Mac I get an error that there are No options provided for this parameter
I am creating a widget that has configurable content and I'm getting this error on the Mac OS when running the WidgetExtension in the Mac WidgetKit Simulator
The operation could not be completed. (CHSErrorDomain error 1101.)
I must be missing something somewhere, all my other widgets are working fine, but with the dynamic widget where the user can edit the widget in the swift file I'm always getting warnings that appear then disappear about
Cannot find type 'DynamicPersonSelectionIntent' in scope
When I build it goes away.
I have added DynamicPersonSelection.intentdefinition, I have an IntentHandler.swift with an IntentHandler: DynamicPersonSelectionIntentHandling.in the Target Intent handler I have added the supported Intent, In the framework section is the Intents.framework. I have check all the Tagret memberships I think. The widget works sometimes? on the iPhone but not on the Mac at all.
I must be missing something. Please help if you can.
I didn’t know I had to do anything on the developer CloudKit dashboard. After putting my app in the store and CloudKit not working I found this, went to the CloudKit dashboard, cleaned up the ‘Schema’ for the iCloud container I wanted to use, then chose the cog, deploy schema to production and its working.
Hi,
Thank you for the Swift reply. The example you provided proceeded with no error, which is a good thing and the phone numbers were stored and accessed, its working I think. Thank you. I changed the transformable type in the Core data to NSArray and allowedTopLevelClasses to return [CNLabeledValueCNPhoneNumber.self, NSArray.self, CNPhoneNumber.self] //- as you suggested and it worked. So thank you again. I am going to try now to do the same with CNLabeledValueNSString and a postal address, that should be similar.
Thank you! I really appreciated your help.
Hi, I think I found the answer
let storeDirectory = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first!
let url = storeDirectory.appendingPathComponent("local.sqlite")
let local = NSPersistentStoreDescription(url: url)
...
let cloudUrl = storeDirectory.appendingPathComponent("cloud.sqlite")
let cloud = NSPersistentStoreDescription(url: cloudUrl)
Something to do with the path as I thought.
Changing those lines seams to have made it work.
Me too
I just needed to add import ClockKit
Working.
I just needed to add import ClockKit
Working.