Depending on your needs, you will need to open Word, PDF, Excel and other files in your project, and add them in the Info.plist file.
<Key>Cfbundledocumenttypes</Key> <Array> <Dict> <Key>Cfbundletypename</Key> <string></string> <Key>Lsitemcontenttypes</Key> <Array> <string>Com.microsoft.powerpoint.ppt</string> <string>Public.item</string> <string>Com.microsoft.word.doc</string> <string>Com.adobe.pdf</string> <string>Com.microsoft.excel.xls</string> <string>Public.image</string> <string>Public.content</string> <string>Public.composite-content</string> <string>Public.archive</string> <string>Public.audio</string> <string>Public.movie</string> <string>Public.text</string> <string>Public.data</string> </Array> </Dict> </Array>
A third-party app opens a file that calls the following proxy method
/** Open File Call Agent @param application own app @param URL The sandbox address of the file when the third-party app is called @param sourceapplication the third-party app that calls our app who @param an Notation @return The return value is Yes*/-(BOOL) Application: (UIApplication *) application OpenURL: (nsurl *) URL sourceapplication: (Nullable NSString *) sourceapplication Annotation: (ID) annotation{if(Self.window) {if(URL) {nsstring*filenamestr =[url lastpathcomponent]; NSString*doc = [[Nshomedirectory () stringByAppendingPathComponent:@"Documents/localfile"] STRINGBYAPPENDINGPATHCOMPONENT:FILENAMESTR]; NSData*data =[NSData Datawithcontentsofurl:url]; [Data Writetofile:doc Atomically:yes]; NSLog (@"file is stored in a local folder"); } } returnYES;}
iOS calls third-party programs to open files, and third-party calls to their apps to open files
Third-party apps in IOS app call their apps, open files