iOS Question Opening a GPX File / Plist help [Solved]

JustinLong

Member
Licensed User
I have an app that opens a GPX (GPS coordinates), imports them into a table, then lets you launch Waze by clicking on the waypoint.

It was working fine yesterday. I sent it to the AppStore and loaded it from TestFlight. It was working. Now today, it won't allow me to select GPX files through the Document Picker. (They are grayed out)

I'm guessing this has something to do with the Plist, which I've included below.

Any ideas what might have caused this?

Plist:
    #PlistExtra:<key>LSSupportsOpeningDocumentsInPlace</key><true/>
    #PlistExtra:<key>ITSAppUsesNonExemptEncryption</key><false/>
    'gpx
    #PlistExtra:<key>CFBundleDocumentTypes</key>
    #PlistExtra:<array>
    #PlistExtra:    <dict>
    #PlistExtra:        <key>CFBundleTypeIconFiles</key>
    #PlistExtra:            <array>
    #PlistExtra:                <string>Icon.png</string>
    #plistextra:                <string>Icon@2x.png</string>
    #plistextra:            </array>
    #PlistExtra:        <key>CFBundleTypeName</key>
    #Plistextra:            <string>GPS Exchange Format (GPX)</string>
    #PlistExtra:        <key>CFBundleTypeRole</key>
    #PlistExtra:            <string>Viewer</string>
    #PlistExtra:        <key>LSHandlerRank</key>
    #PlistExtra:            <string>Owner</string>
    #PlistExtra:        <key>LSItemContentTypes</key>
    #PlistExtra:            <array>
    #PlistExtra:                <string>com.topografix.gpx</string>
    #PlistExtra:                <string>org.elsners.Indicium.gpx</string>
    #PlistExtra:            </array>
    #plistextra:    </dict>
    #plistextra:</array>

    #PlistExtra:<key>UTImportedTypeDeclarations</key>
    #PlistExtra:<array>
    #Plistextra:    <dict>
    #plistextra:        <key>UTTypeIdentifier</key>
    #PlistExtra:            <string>com.topografix.gpx</string>
    #PlistExtra:        <key>UTTypeReferenceURL</key>
    #PlistExtra:            <string>http://www.topografix.com/GPX/1/1</string>
    #PlistExtra:        <key>UTTypeDescription</key>
    #PlistExtra:            <string>GPS Exchange Format (GPX)</string>
    #PlistExtra:        <key>UTTypeConformsTo</key>
    #PlistExtra:            <array>
    #plistextra:                <string>public.xml</string>
    #plistextra:            </array>
    #PlistExtra:        <key>UTTypeTagSpecification</key>
    #PlistExtra:        <dict>
    #Plistextra:            <key>public.filename-extension</key>
    #PlistExtra:                <array>
    #Plistextra:                    <string>gpx</string>
    #Plistextra:                    <string>GPX</string>
    #Plistextra:                </array>
    #PlistExtra:            <key>public.mime-Type</key>
    #PlistExtra:                <array>
    #plistextra:                    <string>application/gpx+xml</string>
    #PlistExtra:                    <string>application/gpx</string>
    #PlistExtra:                </array>
    #Plistextra:        </dict>
    #Plistextra:    </dict>
    #Plistextra:</array>

EDIT: I've also tried previous versions from on TestFlight that worked and are now exhibiting the same behavior.

In addition I tried adding the following which I believe would allow selecting any file and doesn't work:

B4X:
#PlistExtra: <key>CFBundleDocumentTypes</key>
#plistextra: <array>
#PlistExtra:    <dict>
 #PlistExtra:       <key>CFBundleTypeIconFiles</key>
#PlistExtra:        <array/>
#PlistExtra:       <key>CFBundleTypeName</key>
#PlistExtra:        <string>name</string>
#PlistExtra:        <key>LSItemContentTypes</key>
#PlistExtra:        <array>
#PlistExtra:            <string>Public.data</string>
#PlistExtra:        </array>
#PlistExtra:    </dict>
#PlistExtra:</array>
 
Last edited:

JustinLong

Member
Licensed User
That's what I thought and tried. Unfortunately restarting didn't help.

Am I correct that the second code I posted above (Public.data) should allow the Document Picker to access any file type? EDIT: Yes


Update: I think I found the issue. It looks like this is a problem with iOS itself.

This link discusses the issue at LENGTH. One of the posts quotes a response from Apple support:

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.

I ended up fixing it making it work by deleting apps that I figured would be able to open a GPX file. In my case, I think it was either Pocket Earth Pro, InRoute, or both of them. In either case, as soon as those apps were uninstalled from the phone, my app was immediately able to open GPX files again.
 
Last edited:
Upvote 0
Top