I am developing an react native app for ios in which i need list of pdfs present in my phone i can get the list of pdf present in my app sandbox by this code
RCT_EXPORT_METHOD(get:(NSString *)extension callback:(RCTResponseSenderBlock)callback) { NSString *documentsDir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject; NSArray *files = [NSFileManager.defaultManager contentsOfDirectoryAtPath:documentsDir error:nil]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"self ENDSWITH %@", extension]; NSArray *filtered = [files filteredArrayUsingPredicate:predicate]; callback(@[filtered]);}
but now problem is that i am unable to get the pdf present outside the app sandbox is any way to get that pdfs and their paths in react native(native module)