Skip to content

Instantly share code, notes, and snippets.

@matiasvillaverde
Last active September 23, 2016 13:32
Show Gist options
  • Save matiasvillaverde/1b67e5821f511d495050d9c19ac881de to your computer and use it in GitHub Desktop.
Save matiasvillaverde/1b67e5821f511d495050d9c19ac881de to your computer and use it in GitHub Desktop.
- (void)getCacheOf:(NSString*) documentID withProyectName: (NSString *)proyect {
//Get the proyect also, because is using the default one...
MSIPreferencesStore * store = [MSIPreferencesStore preferencesStore];
MSIDevicePreferences *devicePreferences = [store preferencesCopy];
WebServerList *webServerList = [devicePreferences getWebServers];
MSIProjectConfiguration *project = [webServerList getProjectConfigurationByProjectName:proyect];
[[MSICacheManager manager] retrieveCacheForObjectId:documentID
withPriority:MSMCachePriorityHigh
withElementsPromptAnswers:nil
andValuePromptAnswers:nil
andProjectInfo:[project copyProjectInfo]
completionHandler:^(MSIDocumentCache *documentCache, NSError *error) {
if (!error) {
NSLog(@"Success");
//The user has access.
} else {
//TODO handle error
NSLog(@"--------------Block callback hit!");
NSLog(@"error: %@",error.debugDescription);
//The user can not see the document.
}
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment