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.
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.
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];
}
Related
I am new to iOS and I want to know that, How to change the default browser as Google chrome on iPhone Simulator?
Thank you in advance.
As xlc has mentioned the Simulator doesn't allow you to install third party applications. It's designed to let you test your code and how it interacts with iOS.
You cannot change default iOS default browser unless and until your device is jailbroken.
but you can open links in google chrome from your app using :
[[UIApplication sharedApplication] canOpenURL:
[NSURL URLWithString:#"googlechrome://http://www.nameofwebsitehere.com"]];
Note : this will not work on simulator and you should add a check to see if Google chrome is installed on device.
I'm banging my brain against the wonderful lib xport that is cocos2d-x from the original cocos2d iOS library.
What I want to ask is how to open a web link in the safari browser? I don' know how to link the original objc code
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:]];
I have tried using the LUA engine, that is capable of executing shell commands, but I cannot find the safari app path to launch it.
Thanks, people.
You can't get the paths to other applications. However, if you make that openURL: call to open a URL with the http:// domain then Safari will open it. Have you tried that? What result do you get?
UPDATE:
Caveat: I'm not sitting in front of a machine where I can test this.
NSURL * url = [NSURL URLWithString:#"http://stackoverflow.com"];
[[UIApplication sharedApplication] openURL: url];
That should be all that is required. UIKit will switch to Safari and browse to the supplied URL.
I'm using the following code to open a url in Safari on the iPad.
[[UIApplication sharedApplication] openURL:url];
The problem is that I need to open this URL in an existing tab, not open a new one. Is there any way to do this?
(why?: automated testing framework. I don't want the iPad to be bogged down by having hundreds of tabs open after running for a long period of time)
It is not possible to force Safari to load a URL in an existing tab. But I found out that if the exact same URL is already open in an existing tab, that tab is used when calling [[UIApplication sharedApplication] openURL:url];. So if you can ensure that you use the same URL in all of your tests, you should be able to avoid "hundreds of tabs".
Does anyone know how to launch a web app from a native app?
I assume that this is hard to achive, but the next best thing would be to launch safari with a specific URL, without the URL-bar. And I don't want it to be done within the app, I would prefer if the native app could go into a suspended state.
It's not hard to achieve, it's easy with UIWebView http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://www.makebetterthings.com/blogs/"]];
and enable multitasking in your app so when the safari opens your app will go in suspended mode.
Update -
Read my these blog entries -
http://www.makebetterthings.com/blogs/iphone/open-phone-sms-email-map-and-browser-apps-in-iphone-sdk/
http://www.makebetterthings.com/blogs/iphone/launching-your-own-application-via-a-custom-url-scheme/
unfortunately you can not open all the apps! but you can add custom URL scheme in your own app to open them
Is it possible to launch the "Photos" application from an iPhone app? Similar to launching mail?
[[UIApplication sharedApplication] openURL:url];
The Photos app doesn't appear to register any URL schemes that other apps can use. There's a pretty well-established pattern in other system apps (e.g. Safari) of “saving an image” resulting in that image being placed in the user's camera roll; I'd recommend just sticking with that expected behavior, and perhaps using an alert to direct the user to look there for your app's exported image.
This article looks like it might be useful?
Getting images from the iPhone