How do I associate file types with an iPhone application?

后端 未结 4 1909

On the subject of associating your iPhone app with file types.

In this informative question I learned that apps could be associated with custom URL protocols.

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-21 08:05

    In addition to Brad's excellent answer, I have found out that (on iOS 4.2.1 at least) when opening custom files from the Mail app, your app is not fired or notified if the attachment has been opened before. The "open with…" popup appears, but just does nothing.

    This seems to be fixed by (re)moving the file from the Inbox directory. A safe approach seems to be to both (re)move the file as it is opened (in -(BOOL)application:openURL:sourceApplication:annotation:) as well as going through the Documents/Inbox directory, removing all items, e.g. in applicationDidBecomeActive:. That last catch-all may be needed to get the app in a clean state again, in case a previous import causes a crash or is interrupted.

提交回复
热议问题