• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Opening custom files (iOS) from web
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Opening custom files (iOS) from web


  • Subject: Opening custom files (iOS) from web
  • From: Rick Aurbach <email@hidden>
  • Date: Tue, 21 Mar 2017 01:00:35 -0400
  • Acceptlanguage: en-US
  • Thread-topic: Opening custom files (iOS) from web

While I have lots of experience with apps, my knowledge of all things web is pretty lacking, so I’m asking for pointers rather than a solution to the following problem:

I have an iOS app that supports importing a custom file-type. I’ve defined the document type and exported UITs in my app. The following segment of the app’s info.plist shows how I’ve set up the exported UTI in Xcode:

<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>com.apple.property-list</string>
</array>
<key>UTTypeDescription</key>
<string>A list of poems supported by Poet's Corner</string>
<key>UTTypeIdentifier</key>
<string>com.aurbach.poetscorner.poetry</string>
<key>UTTypeSize320IconFile</key>
<string>shakespeare</string>
<key>UTTypeSize64IconFile</key>
<string></string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>poetry</string>
<key>public.mime-type</key>
<string>application/octet-stream</string>
</dict>
</dict>
</array>


The filename-extension key seems to work because I can open an email attachment with the .poetry file extension. BUT...what I want to do next is to click on a link on a webpage (i.e., an <a href=“”> element pointing to a ‘.poetry’ file) and have the file downloaded and opened by my app. This is not happening.

What currently is happening is that clicking on the link causes the file to be displayed as if it were text in Safari/iOS. The breakpoint in my app in AppDelegate::application(_:open:options) is never triggered. So just setting the mime-type doesn’t seem to do enough.

It appears that I’m missing something, but I don’t know what.  Can anyone point me in the right direction?

Cheers,

Rick Aurbach

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Opening custom files (iOS) from web
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Unicode filenames with Apple File System and UIManagedDocument
  • Next by Date: Re: UITextField width of UIAlertController -addTextFieldWithConfigurationHandler:
  • Previous by thread: Re: UITextField width of UIAlertController -addTextFieldWithConfigurationHandler:
  • Next by thread: Re: Opening custom files (iOS) from web
  • Index(es):
    • Date
    • Thread