I am executing this code to get files/document from iCloud
NSMetadataQuery *metadataQuery = [[NSMetadataQuery alloc] init];
[metadataQuery setSearchScopes:
[NSArray arrayWithObject:
NSMetadataQueryUbiquitousDocumentsScope]];
[metadataQuery setPredicate:[NSPredicate predicateWithFormat:@"%K LIKE 'myfile.zip'", NSMetadataItemFSNameKey]];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(metadataQueryDidFinishGathering:)
name:NSMetadataQueryDidFinishGatheringNotification
object:metadataQuery];
if (![metadataQuery startQuery]) {
NSLog(@"Start query not work for some reason.");
}
I am getting this error
[default] [ERROR] notify_get_state(241) failed with 'invalid_token' (2) for 'user.uid.501.BRNotificationServerAvailabilityChanges'
Due to this error, it doesn't fire
NSMetadataQueryDidFinishGatheringNotification
NotificationCenter.
Anyone face any such issue before.