App unable to import files in iOS13

My app has the ability to import GPX route files. However I am getting reports from users of iOS13 that the app is no longer appearing in the list of available apps when they try to export a GPX file.


Has anyone else seen or heard of this, and does anyone know how I might get around it? As far as I know it is only the Imported UTIs that affect this - is iOS 13 more fussy about how they are specified?

  • I want the experience.

Add a Comment

Replies

I filed FB long time ago and didn't get as thourough response as LeadNav, just "Fix it yourself" resolution. But are you still having a problem? I have not had a single customer complaint since I've merged a range of suggestions in this thread together for my apps. Given response that LeadNav has got, it all makes some weird sense. I use "All files":


<dict>

<key>CFBundleTypeName</key>

<string>All files</string>

<key>CFBundleTypeRole</key>

<string>Viewer</string>

<key>LSHandlerRank</key>

<string>Alternate</string>

<key>LSItemContentTypes</key>

<array>

<string>public.content</string>

<string>public.data</string>

</array>

</dict>


As the last entry in document types. Above this I have the following for kmz:


<dict>

<key>CFBundleTypeIconFiles</key>

<array/>

<key>CFBundleTypeName</key>

<string>KMZ Google Earth</string>

<key>LSHandlerRank</key>

<string>Alternate</string>

<key>LSItemContentTypes</key>

<array>

<string>$(PRODUCT_BUNDLE_IDENTIFIER).kmz</string>

<string>public.archive</string>

<string>public.data</string>

</array>

</dict>


Then I have the following for the kmz in the Exported UTIs:

<dict>

<key>UTTypeConformsTo</key>

<array>

<string>public.data</string>

<string>public.archive</string>

</array>

<key>UTTypeDescription</key>

<string>KMZ Google Earth</string>

<key>UTTypeIdentifier</key>

<string>$(PRODUCT_BUNDLE_IDENTIFIER).kmz</string>

<key>UTTypeTagSpecification</key>

<dict>

<key>public.filename-extension</key>

<array>

<string>kmz</string>

<string>KMZ</string>

</array>

</dict>

</dict>


I have no intent to be adding anything for GPX right now, but I think I could do it in the same way as it is done for kmz. The only benefit that I'd see from adding GPX would be gpx file icons being my app icon sometimes?


I tested this with my own apps (compass 55, speedometer 55, planimeter 55) and they were never competing on any types (I do declare explicitely .sqlitedb, .mbtiles, .kmz and my own .trk) and I think they are not breaking other apps as well.


This led me to having no imported types. Will I need to agree with 1 million devs to have working imported types again? Per Apple's response to LeadNav, yes?


My understanding of this is that for the imported types, instead of merging info from different devs on it, Apple simply overrwites it in iOS 13? Imported types are not owned by the app. Next app comes and becomes the "master" over this imported UTI. If both matched perfectly on UTI there would no conflict?

Exported types are owned by the app. Looks to me that Apple still continues to merge information from the Exported UTIs in iOS 13.


I might be very wrong with my understanding, I hope not, but let me share it here in hope that someone wiser may comment. The solution seems to work, and while not being perfect, I can't suggest my customers to delete other apps (and which ones)? I believe this solution breaks nothing in fellow dev apps and makes my apps immune. I don't think that Apple is right with their new approach to the imported UTIs in iOS 13.

Same isssue with xcode 11.2 and on ios 13.2

I fixed this by adjusting some settings in the app's Info.plist.

I switched

UISupportsDocumentBrowser
to
false
, and added
LSSupportsOpeningDocumentsInPlace
, also set to
false
.

Still no success, the error get from safari is:



"MobileSafari quit unexpectedly."


Application Specific Information:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'

terminating with uncaught exception of type NSException



Here is the full log of the error... https://drive.google.com/file/d/1sfW6-sfC2uj4jlFEKY1BpzLWyL5YKFe7/view

Suppose GPXApp1 has an Imported UTI and Document Type defined as in:

https://stackoverflow.com/questions/31163785/trying-to-define-gpx-document-type-in-xcode-6-4


I found that there are at least two ways which can cause problems:

1) Clear the Conforms To field, then the app will not show up in the list.

2) Create another app GPXApp2 with the same Imported UTI and Document Type, except changing the Identifier and Types to a different value, say com.topografix.gpx2. Then at least one of the apps will not show up in the list.


I found that one solution is to add public.xml to the LSItemContentTypes array. Then both apps can show up in the list. The side effect is that they will also show up in the list for XML files. Probably, it is safer to add public.data instead, but I found that the only case for public.xml to fail is when both apps set the Conforms To field to public.data.

For our app it's still not working for all users.

We tried hunderts of variations of our Document Types and Imported UTIs ... no change...

I would be super happy if somebody has a working config and could post it here.

Are you guys using the Document Types? Or the Imported UTIs?


For me it was working for a while, but now with no change to my code it's not working any more.


And what's also super strange. Even the filepicker is not displaying gpx files correctly.


UIDocumentPickerViewController(documentTypes: ["public.xml", "com.topografix.gpx"], in: .import)


This used to properly highlight all gpx files for me. Now it's not any more.
Our users are really frustrated but we have no idea how to solve the problem.


So any hint on how you guys got it working is extremly appreciated!!!

For import from the Files app, I use the following config:

<key>CFBundleDocumentTypes</key>

<array>

<dict>

<key>CFBundleTypeIconFiles</key>

<array/>

<key>CFBundleTypeName</key>

<string>GPS Exchange Format (GPX)</string>

<key>CFBundleTypeRole</key>

<string>Viewer</string>

<key>LSHandlerRank</key>

<string>Alternate</string>

<key>LSItemContentTypes</key>

<array>

<string>com.topografix.gpx</string>

<string>public.xml</string>

</array>

</dict>

</array>

<key>UTImportedTypeDeclarations</key>

<array>

<dict>

<key>UTTypeConformsTo</key>

<array>

<string>public.xml</string>

</array>

<key>UTTypeDescription</key>

<string>GPS Exchange Format (GPX)</string>

<key>UTTypeIconFiles</key>

<array/>

<key>UTTypeIdentifier</key>

<string>com.topografix.gpx</string>

<key>UTTypeReferenceURL</key>

<string>http://www.topografix.com/GPX/1/1</string>

<key>UTTypeTagSpecification</key>

<dict>

<key>public.filename-extension</key>

<string>gpx</string>

<key>public.mime-type</key>

<string>application/gpx+xml</string>

</dict>

</dict>

</array>


The side effect is that the app will show up for other XML files too, but no good solution until Apple fixes the issue. See whether it works in your environment.


And I do not use UIDocumentPickerViewController, so no idea about it.

I was facing a similar issue. My app wasn't being shown in the list of apps to open the XML attachment from the mail app. I used this code in info.plist and it worked for me:


<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>XML File</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>public.XML</string>
</array>
<key>CFBundleTypeIconFiles</key>
<array>
<string>Sandbox-icon.png</string>
</array>
</dict>
</array>


Refer: http://iosdevelopertips.com/core-services/how-to-register-file-types-supported-by-an-ios-app.html

None of the file formats that my app supports are registered as my own, and never have been. I still have problems with opening 3 out of the 5 file types. So, no, that is not the underlying cause of the problem.

There is no config that is guaranteed to work. One of the other users reported the following feedback from Apple on the issue:


"We understand that you are having issues with your type definition for .gpx files. At this time, there is no commonly-accepted Uniform Type Identifier for .gpx files and different developers have defined their .gpx declaration differently. This means that if two apps are installed on the same device that claim to open these files with different definitions, they won't interact correctly: from the user's point of view, only one of those apps, chosen seemingly at random, will be able to open these files."


That is, if there are two or more apps that have given different Uniform Type Identifiers for the same file extension, then only some of them will appear, choosen at random.

I too am hit by this issue.

I have my own custom UTI for my own files which I serve from a web page.

in iOS 12, Safari puts up "Open in.." when tapping it. Choosing Open in copies the file into my apps Documents dir in a special Inbox subdriectory, where I can read it via the URL. If I use the UIDocumentPickerViewController way , it says "Copy to [my app]", which again puts it in the Inbox.


in iOS 13, it demands to be downloaded instead. Trying to read the downloaded file results in it not being owned by my app and illegible. In fact, I can't figure out what anyone can do with the download's file:// URL that is given to the app in that situation. If I go to the Download part of Files and move (copy really) it into my app's Document dir, it's found.

I've tried a great number of the techniques mentioned, but the truth is: works in iOS 12 perfectly, decides it wants to use the new file system in iOS 13, but still doesn't give access.

I gave up trying all the suggested fixes because in the end it was impossible to tell if they worked because the issue is random. So I very reluctantly made my app accept all file types. Even if Apple were to fix the problem tomorrow it would still be too late. Most people are using iOS13 now and a significantly large amount will still be using it in a year or two, so I can't see myself ever changing the app back to only accepting some file types.


It is very annoying because we told Apple about the issue months before iOS 13 was released but they did nothing and now the file type system is broken for the foreseeable future.

Should be fixed in iOS 13.3. Two apps using different UTIs for an extension can both show up in the list now. Just need to ensure that the Conforms To field is set.

i has the error when import files, how solves ?


2019-12-27 09:34:05.110894+0800 Happy3D[357:24297] *** Assertion failure in -[UIApplication _applicationOpenURLAction:payload:origin:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore/UIKit-3698.140/UIApplication.m:6857

2019-12-27 09:34:05.150198+0800 Happy3D[357:24297] invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. This message will only appear once per execution.

libc++abi.dylib: terminate_handler unexpectedly threw an exception



my inffo.list

<key>CFBundleDocumentTypes</key>

<array>

<dict>

<key>CFBundleTypeIconFiles</key>

<array>

</array>

<key>CFBundleTypeRole</key>

<string>Editor</string>

<key>LSHandlerRank</key>

<string>Owner</string>

<key>CFBundleTypeName</key>

<string>stl file</string>

<key>LSItemContentTypes</key>

<array>

<string>public.standard-tesselated-geometry-format</string>

</array>

</dict>

</array>


my xcode is 11.3,my pad ios is 12.4.4