问题
I have a situation where i have to use some keynote files in my app and for this i have to use Keynote app.
Now my question is that is there any method to open the keynote app from my app (might be from URL scheme). If yes then how to pass my file to that.
Is there any alternative to this i have never used Keynote that is why i have very less knowledge about it.
Please help.
回答1:
There is no official mention of a URL scheme reference for the Keynote iOS app. If you want to try using Keynote files, I suggest you look at UIDocumentInteractionController. If there is an app that can open those files, it will provide the user options to open it.
回答2:
You cannot open a file directly in Keynote from your app by passing it. But you can open Keynote from your app.
In Swift 3
let keynoteUrl = URL(string: "x-keynote-live://")
if UIApplication.shared.canOpenURL(keynoteUrl! as URL)
{
UIApplication.shared.open(keynoteUrl!)
}
In Objective-C
NSURL *keynoteUrl = [NSURL URLWithString:@"x-keynote-live://"];
if ([[UIApplication sharedApplication] canOpenURL:keynoteUrl]) {
[[UIApplication sharedApplication] openURL:keynoteUrl];
}
来源:https://stackoverflow.com/questions/6173749/how-to-open-keynote-app-from-another-app