UIDocumentInteractionController - iphone

I have a problem that make me crazy.
From my app, when an OpenIn menu is shown, I'll choose an application to open the file (ex:DocsToGo) and the document is opened for edit.
But after editing, how can I send it back to my app or get the link where that document is saved ? How can I get new content of that file ?

Your app cannot get access to the changed version of the file. The new version resides within the sandbox of the app to which you sent it. The only way you can get the file back into your app is if your app registers as an application that can open that document type. THEN you have to hope that the other application gives the user the option to open the new file in another application.
Another option is to use a third party cloud service for storing the documents. Many apps integration with Dropbox now. If your app and DocsToGo both used Dropbox, then you would be able to both edit the same document and get access to it.
In short: there is no Apple-supported way for your app to send a document to another app and then pull it back after changes have been made.

Your app can't "pull" the changed file, as Mark Suman mentioned in his answer, but if the user pushes it back to you from the other app with a similar "open in..." command, you can implement a workflow where a file is passed from your app to another and back again. When the file is sent back to your app, it triggers the application:handleOpenURL: method in the app delegate (or application:openURL:sourceApplication:annotation: in iOS 4.2+). The URL argument is the URL of the edited file, which your app can then resume working with.
More info here.

Related

how to set text in another app for ios

Is it possible for an app to
Detect whether the last app used by user is WhatsApp.
Open WhatsApp and set text.
Set text directly in the opened conversation.
No, you can not access the app history.
Yes, you can using url-schemes. Read Whats App's documentation.
See 2
Simply No.
You cant access the user history.
You cant open another app within another app.
You cant access another app.

How to launch iOS app via custom URL and allow to open a webpage if it's not installed?

I'd like to be able to send invitation in an email to a specific "event" happening inside my iOS app. So I figured I'd need to use custom URL. That's fine.
But I'd also like to be able to handle the user that doesn't have the app installed yet, to be taken to a mobile Safari and to the webpage with installation instructions for the app.
What would be the best way to do it?
I could try the following:
In the email I send a link to a http://www.example.com/joinevent/?id=foo
User is taken to a Safari webpage that sends a redirect to mycustomscheme://joinevent/?id=foo
If the user doesn't have the app installed this redirection won't work and he stays in the Safari - I could then handle the displaying of installation instructions probably.
But this approach doesn't seem "natural" for me. Is there a better/more native way to do it?
Try http://rdrct.it
It is a web service that allows you to achieve exactly this functionality very easily.
Full disclosure - I created rdrct.it
Here's the basics:
Login to the site, create a project for your particular app. Choose a unique code (this could be the name of your app).
You'll then be provided with a URL in the form: http://rdrct.it/uniqueCode
Once you've done that, you need to register the app's ID in the app store, and also details about the custom URL scheme. Tick "Auto-redirect" - what it will then do is try to open the app, and if that fails, it will automatically send the user to the app store.
If the app is opened, then the querystring is also passed to the app, so in your example case, the device will have been served: mycustomscheme://joinevent/?id=foo
It also works across multiple device types, so if you have the app available for Blackberry, Android or Windows Phone, then it will also do the same for those depending on which device type the user is using.
Like I said, I created it, but it should solve your problem.
If you are using Distimo to track you app analytics, they provide a shortlink to your apps that can be used also used to track conversions. It shows a custom page depending on the device used to access. This is especially convenient if you have the same app published in the AppStore, Google Play, Amazon, etc.

How to relaunch an app like facebook-ios-sdk does?

Question:
I am actively looking in the source code on Github's facebook-ios-sdk project myself but I was wondering if anyone already knows how to relaunch an app that sent an iPhone user to Safari, such that the user can come back after some work has been finished?
Example:
When using facebook to login, the original app is relaunched after the facebook login page has authenticated the user.
Motivation:
I would like to be able to do the same for youtube videos without having to completely lose the user. I don't want to use the standard webview approach because I don't want to provide extra space to first let the video load for the user and then have the user click the play button. I want to skip the play button and its associated click entirely! Instead I want the user to be able to click on just an everyday regular iPhone button and be shown the video with the navigation for coming back to the app via relaunch.
You need your app to register a "custom URL scheme". Then get the callback in the remote web service to return a URL with that scheme. iOS will then launch your application.
More (somewhat old) info available here.
A list of common custom URL schems on iOS can be found here.
Generally, as part of the OAuth login process, you supply a callback URL as one of the paramaters. What this does, is tell the remote server (YouTube), that on successful authentication, redirect the user to the supplied URL. If YouTube supports this (does it support OAuth?) then on successful user login within safari, youtube will tell users safari to redirect to the supplied url. If this url is a "custom URL scheme" it will cause your app to relaunch and you can handle the situation from there.

iPhone app: tap this button to update to the latest version

I basically need a url to open that will end up at the updates tab of the AppStore app. Preferably at the update screen for my app. Is such a thing possible?
I know you can open the app itself, or even the reviews page for the app. But when prompting users to upgrade, the "buy/free" button is actually grayed out and says "installed". Which is pretty unintuitive. We could just have text that instructs the user what to do, but it would be far better we could go directly the update page for our app. We can remotely update content in our old app, so it would be easy to have button or link that takes them to the update tab, assuming I knew what the magic url was.
There's no such URL. About all you can do is tell the user to check the App Store for an update and block them from progressing further into your app until they've installed the new version.
Someone has found a URI that will link to your app's update page:
how do you link directly to app store app update page?
You'll find the answer in the question. Frankly, I'd prefer an update URI as well.

How can I get the app store link to upgrade my app (iphone)?

I'm trying to prompt the user (once, I record it) to upgrade the iphone app if it is out of date. I've found a few sites that explain how to get the link to your app in the app store once it is already there. Here's one for example.
The problem is, all these guides require the app to be in the store before you can get the ID to link to it. This is a new app. Is it impossible to figure out what your app ID (and link) will be before submitting your code? Therefor it is impossible for your first version to have an upgrade link embedded?
You can link to http://itunes.com/app/App_Name, if your app's name is unique.
Your other option would be to fetch the update notice with an HTTP request instead of building the wording into the app. That'd let you present any message with wording you could determine on your web server, not in the code itself.