Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

could we search the pdf outside the app sandbox in ios

$
0
0

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)


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>