views:

251

answers:

2

I am have some PDFs in my app. I want to provide an option to open those in other third party e-readers that might be installed on the device, like Stanza and iBooks. Dropbox application has successfully implemented this feature and I can't find any information on how to detect what other e-readers are available on the device or what the custom url scheme is for those apps. Any help would be greatly appreciated. thanks in advance guys.

A: 

You don't need to detect the other apps, you need to know the url that can open them.

A call like this:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.apple.com"]];

Tells the phone to open the page in whatever app handles http/html requests which is safari. iBooks has their own url format which hopefully you can track down.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"ebook://iRobot.pdf"]];

NOTE: that's not correct, just meant to illustrate a different url scheme.

NWCoder
+2  A: 

Check this out!

http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIDocumentInteractionController_class/Reference/Reference.html#//apple_ref/occ/cl/UIDocumentInteractionController

eliego
thank you so much. this was exactly what I was looking for.
Bittu
could anyone give a concrete example on how to use it?
Fossli