Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For completeness and possibly my own reference later here is a bit of the further details that got it working for me:</p> <p><strong>Declaring Document Types your app supports</strong> (eg sqlite3 databases)</p> <pre><code>&lt;key&gt;UTExportedTypeDeclarations&lt;/key&gt; &lt;array&gt; &lt;dict&gt; &lt;key&gt;UTTypeIdentifier&lt;/key&gt; &lt;string&gt;com.company.sqlite3.database&lt;/string&gt; &lt;key&gt;UTTypeReferenceURL&lt;/key&gt; &lt;string&gt;http://www.company.com/&lt;/string&gt; &lt;key&gt;UTTypeDescription&lt;/key&gt; &lt;string&gt;MyCompany SQLite Database&lt;/string&gt; &lt;key&gt;UTTypeIconFile&lt;/key&gt; &lt;array&gt; &lt;string&gt;Icon-Small.png&lt;/string&gt; &lt;string&gt;Icon.png&lt;/string&gt; &lt;/array&gt; &lt;key&gt;UTTypeConformsTo&lt;/key&gt; &lt;array&gt; &lt;string&gt;public.database&lt;/string&gt; &lt;string&gt;public.data&lt;/string&gt; &lt;/array&gt; &lt;key&gt;UTTypeTagSpecification&lt;/key&gt; &lt;dict&gt; &lt;key&gt;public.filename-extension&lt;/key&gt; &lt;array&gt; &lt;string&gt;sqlite&lt;/string&gt; &lt;/array&gt; &lt;key&gt;public.mime-type&lt;/key&gt; &lt;array&gt; &lt;string&gt;application/x-sqlite3&lt;/string&gt; &lt;string&gt;application/octet-stream&lt;/string&gt; &lt;/array&gt; &lt;/dict&gt; &lt;/dict&gt; &lt;/array&gt; &lt;key&gt;CFBundleDocumentTypes&lt;/key&gt; &lt;array&gt; &lt;dict&gt; &lt;key&gt;CFBundleTypeName&lt;/key&gt; &lt;string&gt;MyCompany SQLite Database&lt;/string&gt; &lt;key&gt;CFBundleTypeIconFiles&lt;/key&gt; &lt;array&gt; &lt;string&gt;Icon-Small.png&lt;/string&gt; &lt;string&gt;Icon.png&lt;/string&gt; &lt;/array&gt; &lt;key&gt;CFBundleTypeExtensions&lt;/key&gt; &lt;array&gt; &lt;string&gt;sqlite&lt;/string&gt; &lt;/array&gt; &lt;key&gt;CFBundleTypeMIMETypes&lt;/key&gt; &lt;array&gt; &lt;string&gt;application/x-sqlite3&lt;/string&gt; &lt;string&gt;application/octet-stream&lt;/string&gt; &lt;/array&gt; &lt;key&gt;LSHandlerRank&lt;/key&gt; &lt;string&gt;Alternate&lt;/string&gt; &lt;key&gt;LSItemContentTypes&lt;/key&gt; &lt;array&gt; &lt;string&gt;com.company.sqlite3.database&lt;/string&gt; &lt;/array&gt; &lt;key&gt;NSPersistentStoreTypeKey&lt;/key&gt; &lt;string&gt;SQLite&lt;/string&gt; &lt;/dict&gt; &lt;/array&gt; </code></pre> <p>Copy paste the above XML into your Info.plist file.</p> <p>Setting the 'Store Type' to 'SQLite' didn't wasn't the killer fix for me. </p> <p>My previous post here mentioned a rather incorrect way of getting it to work which accepts all files and didn't properly export the type.</p> <p>Also if your app is emailing off these files as attachments make sure it matches the MIME type you set it to capture. The application/octet-stream is not important it is just that older versions of our app are emailing out the databases with that MIME type.</p> <p>eg,</p> <pre><code>[controller addAttachmentData:[NSData dataWithContentsOfFile:dbPath] mimeType:@"application/x-sqlite3" fileName:filename]; </code></pre> <p>I sure hope anyone else that tries to find out how to get their app to support opening sqlite3 database backups finds this helpful.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload