How to Open KeyNote app from another app

↘锁芯ラ 提交于 2019-12-13 02:27:26

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!