Reputation: 1656
Let's say I have registered several schemes as appropriate for my app, such as text file and PDF.
I open an attached file in the mail app. My app is invoked, and the handleOpenURL method is fired with an URL.
Do I have to (crudely) parse the URL, or.. what?
Upvotes: 0
Views: 231
Reputation: 539685
You can call the NSURL
method getResourceValue:forKey:error:
with the NSURLTypeIdentifierKey
to get the uniform type identifier (UTI) of the file passed to the application.
Upvotes: 1
Reputation: 89509
It isn't that hard to get at important bits of the URL (via NSURL's pathExtension, for example, you might know what kind of .doc or .pdf or .txt file you're trying to open)
Upvotes: 1