Hi,I saw the WWDC talk on the new Contacts framework, and I had a couple of questions about the identifier property:When users upgrade from iOS8 to iOS9, will their old AddressBook recordIDs still work if we are using the AddressBook framework in the app (i.e. haven't upgraded to using Contacts framework)?Are the new CNContact identifiers consistent across iOS and Mac devices? i.e. if we have the identifier on one device, we can lookup the contact on another device with the same identifier?Can these identifiers change in the lifetime of that contact? This was a problem with AddressBook recordIDs ... if you removed the account and then synced it back again, all the contacts would get a different identifier. Same with restoring the device. Will the CNGroup and CNContainer identifiers also be consistent across devices?Hope someone in the Apple Contacts frameworks team can answer. Thanks.
Post
Replies
Boosts
Views
Activity
I'm deliberating on whether to use CloudKit for an app that requires sharing data amongst self-created groups of users (for e.g. sharing company-wide directories). I would use a public database for this, but I had a couple of questions:- if I create a subscription to listen to record changes for a partcular record type, will all the users get a notification when data changes, or only the logged-in iCloud user amongst his/her multiple devices? can there by 'group' notifications that cross iCloud users?- if there's no way for a 'group' of users to get notifications, I guess polling from the app to CloudKit would work, with the groupID part of the predicate? Or is there another options?Thanks.
I have a couple of questions about NSSharingService, specifically with NSSharingServiceNameComposeEmail:1) I use [NSSharingService sharingServiceNamed:NSSharingServiceNameComposeMessage], then set the correct parameters and call `performWithItems` on it. This works fine if the Mail app is configured to be the "Default email reader" in Mail.app's Preferences. If I change this to some of the other email clients I have, this doesn't work anymore. I have tried MS Outlook, Airmail and Unibox apps, and this doesn't work in any of them. Is this intentional? Does the sharing service with NSSharingServiceNameComposeMessage only work for Mail.app?2) If that isn't the case, and other apps can be responsible for composing emails as well, what does an app have to do to handle this? If I want to set myself as an email client app, and let others call ComposeMessage, what API should I implement? If anyone has an idea on how to do this, would really appreciate the help.Thanks.
Is there any particular reason why the Core Data concurrency debug flag throws an exception when using NSAsynchronousFetchRequest? It semes to be happening in both iOS10 and iOS11. This is the code I was testing:- (void) testAsync {
NSManagedObjectContext *spotlightMOC = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];
spotlightMOC.name = @"BackgroundMOC";
NSPersistentStoreCoordinator *psc = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:self.managedObjectModel];
[psc addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:self.persistentStoreCoordinator.persistentStores.firstObject.URL options:@{NSReadOnlyPersistentStoreOption: @YES, NSMigratePersistentStoresAutomaticallyOption: @YES, NSInferMappingModelAutomaticallyOption: @NO} error:nil];
[spotlightMOC setPersistentStoreCoordinator: psc];
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName: @"Person"];
NSAsynchronousFetchRequest *asynchronousFetchRequest = [[NSAsynchronousFetchRequest alloc] initWithFetchRequest:fetchRequest completionBlock:^(NSAsynchronousFetchResult *result) {
if (!result.operationError) {
NSLog(@"processAsyncResult count = %lu", (unsigned long) result.finalResult.count);
NSLog(@"print = %@", result.finalResult);
}
}];
[spotlightMOC performBlock:^{
NSError *asynchronousFetchRequestError = nil;
/
[spotlightMOC executeRequest:asynchronousFetchRequest error:&asynchronousFetchRequestError];
if (asynchronousFetchRequestError) {
NSLog(@"Unable to execute asynchronous fetch result.");
NSLog(@"%@, %@", asynchronousFetchRequestError, asynchronousFetchRequestError.localizedDescription);
} else {
NSLog(@"AsyncRequest executeRequest finised without error");
}
}];
}With the -com.apple.CoreData.ConcurrencyDebug flag set to 1 in "Arguments Passed On Launch", I always hit an exception that says "CoreData`+[NSManagedObjectContext __Multithreading_Violation_AllThatIsLeftToUsIsHonor__]:"What concurrency violation am I committing here? Or is this a bug with Xcode / Core Data?
Hi,I am rrying to add unit tests for my CloudKit error handling code. One of my tests requires me to set the 'recordChangeTag' property to something that's not nil (so it can simulate an existing server record) ... but I can't figure out a way how to set this. Setting a value using the record.recordChangeTag doesn't work, wont even compile. I tried using [record setObject: @"aad" forKey:@"recordChangeTag"]; but even that fails at run-time, failing with this:"caught "NSInvalidArgumentException", ""recordChangeTag" is a reserved key name"Is there any other way to set this? I need to test some conflict-handling code, and the only way to do this sensibly is to simulate an existing server record, which you can't do without a 'recordChangeTag'.
Hi,I'm starting to work on adding a auto-renewable subscription in my app to unlock certain features. I understand the StoreKit and iTC details, but one thing that's not clear to me is *why* we need to do receipt validation for in-app purchases? There seems to be a lot of empasis on doing this, and it gets complicated because you need to either import different libraries to do this client-side (which isn't the recommended option) or do it server-side, which adds a lot of overhead. In my case, I don't have any server running at all, and my whole app relies on CloudKit instead. So I'm wondering why it's so essential in case of IAP. a) if it's for preventing piracy, shouldn't that apply to paid-apps as well? But no one talks about reciept validation for paid-up-front apps.b) when StoreKit's paymentQueue "updatedTransactions" delegate tells us that someone has purchased an IAP, is that something that can be spoofed? I would imagine not, and even so, this would only be possible with jailbroken devices. Is that what people are worried about? How much of a problem is this in the real world? c) is there certain information in the reciept that is essential for subscriptions to work correctly? In my mind, the simplest implementation would be this: display the IAP products, implement the storekit delegate to see when the user purchased the product and mark that user's CloudKit "User" record with the type and date of subscription (this can also be used to restore the IAP on another device) and unlock the features. When the next billing cycle comes, I can wait for StoreKit to tell me whether the user cancelled or continued the subscription, and lock/unlock the feature accordingly. I don't see the necessity of receipt validation in this case. But I might be wrong and misguided about my assumptions. Would love some comments about this.
What's the recommendation when working with multiple custom intents per target? Should we make separate Intents Extensions for each? Or one extension, but with separate Intents Definition files? Or can we create multiple custom intents from the same IntentsDefinition file? I am trying to use this in iOS13 Beta2 (with custom parameters). I was able to create multiple intents in the same file, but when donating the 2nd intent, I get a random error about "Cannot donate interaction with MySecondIntent that has no valid shortcut types"
I read somewhere around WWDC that we can now remove the legal boilerplate content from the page where we sell auto-renewing subscriptions from the app. Does anyone know if you can also remove the same from the App Store "Description" field? I can't find any link or article that confirms this. By boiler-plate, I mean .."subscriptions will automatically renew unless canceled within 24 hours before the end of the current period ... " and all that required text.
Hi,My app supports 2 different share extensions, and before iOS13, it was easy to tell them apart, because I would specify this in the Bundle Display Name (CFBundleDisplayName in info.plist). With iOS13, it seems to only show the name of the app for both share extensions, and not the Display Name specified, which will make it confusing to users if they see the same app icon + name in the share sheet.I filed a Radar for this, but it was returned with "Resolution:Investigation complete - Change required from 3rd party" ... but it didn't specify what kind of change to make.Anyone know how to customize the name of the share extension going forward?Thanks.
Hi,I have been NSMetadataQuery to monitor the Documents folder of my app to pick up new files that were added. This stopped working in Catalina. Is this a documented issue or change in functionality? Is there any new security permission or privacy thing that I have to enable in my app to continue monitoring the local Documents folder from my own app?This is the code I was using the setup folder monitoring (which works fine in Mojave ... but not in Catalina):self.metadataQuery = [[NSMetadataQuery alloc] init];
[self.metadataQuery setSearchScopes:@[dropLocation.path]];
[self.metadataQuery setPredicate:[NSPredicate predicateWithFormat:@"%K LIKE '*.eml'", NSMetadataItemFSNameKey]];
[[NSNotificationCenter defaultCenter] addObserverForName:NSMetadataQueryDidFinishGatheringNotification
object:self.metadataQuery
queue:nil
usingBlock:^(NSNotification *note) {
// do nothing ... not sure why it's required
NSLog(@"NSMetadataQueryDidFinishGatheringNotification called");
}];
[[NSNotificationCenter defaultCenter] addObserverForName:NSMetadataQueryDidUpdateNotification
object:self.metadataQuery
queue:nil
usingBlock:^(NSNotification *note) {
NSLog(@"NSMetadataQueryDidUpdateNotification called");
[self processResultsForQueryWithStartDate: date];
}];
[self.metadataQuery startQuery];
I have a MKMapView in my app, and I want the user to be able to switch the map type, so it can be either MutedStandard, Standard, Satellite or Hybrid. I've hooked up a UISegmentedControl on the Map view controller to change the map types. The problem is, as I try to switch between MutedStandard and Standard (or vice versa), the map view never updates! It works fine for every other type change ... and it works if I quit and reload the app, but the real-time map type change never works if it's just between MutedStandard and Standard.The other strange thing is that it works fine on iOS12 ... just not on iOS13.Here is the simple code that handles this:- (IBAction) updateMapTypeSegmentControlValueChanged:(id)sender {
[[NSUserDefaults standardUserDefaults] setInteger:self.segmentMapType.selectedSegmentIndex forKey:MapViewSettingsDisplayType];
[self updateMapDisplayType];
}
- (void) updateMapDisplayType {
NSUInteger mapType = [[NSUserDefaults standardUserDefaults] integerForKey: MapViewSettingsDisplayType];
switch (mapType) {
case 0:
{
NSLog(@"MapView: updateMapDisplayType - setting to Muted");
self.mapView.mapType = MKMapTypeMutedStandard;
break;
}
case 1:
{
NSLog(@"MapView: updateMapDisplayType - setting to Standard");
self.mapView.mapType = MKMapTypeStandard;
break;
}
case 2:
{
NSLog(@"MapView: updateMapDisplayType - setting to Satellite");
self.mapView.mapType = MKMapTypeSatellite;
break;
}
case 3:
{
NSLog(@"MapView: updateMapDisplayType - setting to Hybrid");
self.mapView.mapType = MKMapTypeHybrid;
break;
}
default:
{
self.mapView.mapType = MKMapTypeMutedStandard;
break;
}
}
}Seems simple enough, but doesn't work on iOS13. I've tried using dispatch_after to make it change the type after 1 second, but that didn't work. Also tried calling [mapView setNeedsDisplay]after changing the map type, but that didn't help either. Any ideas of what I can try to make this work?
HiI'm trying to use Xcode's "Build With Timing Summary" feature. It kicks off a build, and I can see the new build in the Build Reports navigator, but when I look through All Messages in the build results, there is "Timing Summary" information. It just says "Build Success - <date> - 75 seconds", but there isn't a breakdown of the timing results.My target builds an iOS app with many extensions, so I can't post the whole logs here. But is there any reason why I can't find the timing results? I do have that older Xcode flag 'ShowBuildOperationDuration' which still works, but only gives the same overall build summary time, not a breakdown.
Hi,I am planning to use SKReceiptRefreshRequest inside a BGAppRefreshTaskRequest in iOS13, to check whether a subscription has auto-renewed or not. I haven't seen it documented anywhere whether this is supported or not. I've tried it using the sandbox, and sometimes it works, sometimes it asks me to login to the Sandbox account again while the app is running in the background, and sometimes it doesn't work at all.I am calling the _simulateLaunchForTaskWithIdentifier call to simulate a background App Refresh. I do this while the app is in the background, and it sometimes gets stuck. It works better if the app is in the foreground and I call the same private API to simulate the App Refresh.I'm just wondering how reliable this would be in production. Would it keep bothering the user to login to their account? Is it expected that the StoreKit APIs be called from the background APIs (even to refresh a reciept), or is there some limitation that I'm not aware of? Just wanted to do the due-diligence before sending an update to production users.
I can't build even a simple SwiftUI file in my project without running into an error in the Preview pane, which says "Cannot preview this file - not building -Onone".
When I tap the little info button, it shows me this message:
OptimizationLevelError: not building -Onone
"CJDashboard.app" needs -Onone Swift optimization level to use previews This is with Xcode11.5. My project file has been around for quite a while, but I keep updating it frequently, so I'm not sure what setting I've missed. The code compiles file, but I can't see any live previews with SwiftUI.
Can anyone help me figure this out? Thanks.
Hi,
A couple of questions about changes in iOS14: Are there any changes to the limits for intents parameters? With iOS13, I believe you can only have 10 or so parameters in an intent. Is that still the case?
Looking at the intents definition file in XCode12, there doesn't seem to be anything different with the parameters. So there's still no option to specify "optional parameters"?
Thanks.