views:

128

answers:

1

Hi

I'm trying to intercept some kind of files while using iPad's Safari browser. As you probably know, Safari can't download files, so it would be useful Safari to send my app those files links.

As I've read in the iPhone/iPad developer documentation, you can add an URL Custom Scheme to handle some special protocols (like youtube: or tel: to open either youtube or dial a number), but I don't want to handle a special protocol but a special kind of file using regular http/https protocol.

It would be nice if the URL scheme could be something like:

http://*.zip

I have tried to search some docs, and I've tried even in the simulator, but I cannot be able to design a proper URL Scheme to catch a zip file.

Can I handle this situation using the CFBundleURLTypes and the CFBundleURLSchemes parameters into my application .plist ?

If you cannot do that using this method, is there another way to achieve this?

Thanks ;)

A: 

You should specify the file types your app supports in your Info.plist under the CFBundleDocumentTypes key. Applications who support launching files in other apps (incl. Mail and Safari) can then launch your app and pass the file.

For more info, search the documentation for CFBundleDocumentTypes.

Ole Begemann
Thanks for the Reply. I'm going to give it a try :)
HyLian
I Have tried to add this using this:<key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>zip</string> <key>CFBundleTypeRole</key> <string>Editor</string> <key>LSItemContentTypes</key> <array> <string>com.pkware.zip-archive</string> </array> <key>LSTypeIsPackage</key> <false/> <key>NSPersistentStoreTypeKey</key> <string>XML</string> </dict> </array>But when I open a zip file in Safari, it doesn't launch my application :(
HyLian