open iBooks from my app

后端 未结 3 617
孤独总比滥情好
孤独总比滥情好 2021-01-14 15:30

I have some PDF in my app. I want to provide an option to open those PDF in other third party e-readers app that might be installed on the device, like Stanza and iBooks.

3条回答
  •  被撕碎了的回忆
    2021-01-14 16:07

    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.

提交回复
热议问题