How to open files in my application as a default application?

40 Views Asked by At

I am writing an iOS application that can import/export GPX file. How I can implement that my application showing in "Files" as on screenshots below?
I want that the icon of my app showing on the file and on the file format as app name as on screenshots.

enter image description here

My Info.plist contain this:

<key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>UIFileSharingEnabled</key>
            <true/>
            <key>CFBundleTypeExtensions</key>
            <array>
                <string>gpx</string>
            </array>
            <key>CFBundleTypeIconFiles</key>
            <array>
                <string>newLauncher-1.jpg</string>
            </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>com.apple.dt.document.gpx</string>
                <string>public.xml</string>
                <string>public.content</string>
                <string>public.data</string>
                <string>public.gpx</string>
            </array>
        </dict>
    </array>
<key>UTImportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.xml</string>
                <string>public.content</string>
                <string>public.data</string>
            </array>
            <key>UTTypeDescription</key>
            <string>GPS Exchange Format (GPX)</string>
            <key>UTTypeIconFiles</key>
            <array>
                <string>newLauncher-1.jpg</string>
            </array>
            <key>UTTypeIdentifier</key>
            <string>com.topografix.gpx</string>
            <key>UTTypeReferenceURL</key>
            <string>http://www.topografix.com/GPX/1/</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <array>
                    <string>gpx</string>
                    <string>GPX</string>
                </array>
                <key>public.mime-type</key>
                <array>
                    <string>application/gpx+xml</string>
                </array>
            </dict>
        </dict>
        <dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.xml</string>
                <string>public.xml</string>
                <string>public.content</string>
                <string>public.data</string>
            </array>
            <key>UTTypeIdentifier</key>
            <string>com.topografix.gpx</string>
            <key>UTTypeReferenceURL</key>
            <string>http://www.topografix.com/GPX/1/1/</string>
            <key>UTTypeIconFiles</key>
            <array/>
            <key>UTTypeDescription</key>
            <string>GPS Exchange Format (GPX)</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <array>
                    <string>gpx</string>
                </array>
                <key>public.mime-type</key>
                <string>application/gpx+xml</string>
            </dict>
        <dict/>
    </array>
0

There are 0 best solutions below