Problem registering file type via UTI

I use AquaticPrime to generate a license in my application, and since the development guide tells me that I'm trying to register my own file extension, so users can simply click on the license and my application will open it and then check the license.

To do this, I added the exported UTI declaration to my Info.plist as follows:

<key>UTExportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeDescription</key>
        <string>MyApp License File</string>
        <key>UTTypeConformsTo</key>
        <array>
            <string>public.xml</string>
        </array>
        <key>UTTypeIdentifier</key>
        <string>com.mycompany.myapplicense</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <array>
                <string>myapplicense</string>
            </array>
        </dict>
    </dict>
</array>

However, when I double-click on a file with this extension, it does not open in MyApp, and MyApp does not appear as one of the recommended applications for opening a file type. In addition, when viewing the "Information" panel for a file, a description of the file type, as described above, is not displayed.

- - UTI, - , ?

+3
2

CFBundleDocumentTypes.

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeIconFile</key>
        <string>MyAppLicenseIcon</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>NSDocumentClass</key>
        <string>MyAppLicenseHandler</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.mycompany.myapplicense</string>
        </array>
    </dict>
</array>
+3

, , UTI:

        <key>UTTypeConformsTo</key>
    <array>
        <string>public.xml</string>

.plist, - xml. , , UTI .

0

Source: https://habr.com/ru/post/1756982/


All Articles