How to read content of an iOS app from another app? - ios

I am stuck somewhere. My client wants me to develop an application that has a dedicated icon over other applications as well. For example – If I have an ecommerce application opened in my iPhone, there should be an icon over that application through which I can take screenshot and add the image to my application. I know this is possible in android, but is it possible in iOS as well, if yes then how?? Also refer the image attached for more clarification.

Share data between two applications
Historically, the iPhone has tried to prevent data sharing between apps. The idea was that if you couldn't get at another app's data, you couldn't do anything bad to that app.
In recent releases of IOS, they've loosened that up a bit. For example, the iOS programming guide now has a section on passing data between apps by having one app claim a certain URL prefix, and then having other apps reference that URL. So, perhaps you set your event app to answer "event://" URLs the same way that a webserver answers for "http://" URLs.
Have a peek under "Implementing Custom URL Schemes".

Related

Is it possible to get info on other installed iOS apps?

Is it possible to read the contents of another application installed on an iPhone? What about from an extension or keyboard?
I'm trying to come up with something that 'checks' other apps to see if they have any deep links (like Twitter's Twitter://timeline that takes users straight to the timeline in the Twitter app).
Is there any smart way to check a given app for deep links?
Is it even possible to peek at another app's contents from within my app? I suspect no.
If no, what about making a keyboard or extension of some sort that I can access from an app like Twitter and see its contents, such as a URL deep link?
You don't have much options, you may use -canOpenURL:, but, since iOS9, must include special credentails listing all the custom schemes you want to check.
You can't read other app's contents on a non-rooted device unless this app is sharing a keychain (so it can exchange data via the shared keychain). The same thing goes with extensions.
iOS has some high bars on security, so, don't expect much or even, anything.
Something you may want is IntentKit. Also there are ideas around the web about standard url query format like MobileDeepLinking.

Application inside another application in iOS

How do you import or display an application inside another application?
It is like, it will be a part of the app where you can use it's functionalities. Maybe in full screen or not in full screen. My thoughts are these are web based and is being opened in a UIWebView to use the functionalities.
Extensions? It's more like "piggybacking".
Here's an example:
https://hub.united.com/en-us/news/web/pages/uber-on-the-united-app.aspx
I'll post an answer regrouping my answer and also #Popeye one that seems valid too.
There may be a few ways to do it, each ones of them may act differently.
The other app offers a public SDK/API/WebServices
As an example, I'll take FaceBook API, that allow you to login giving you a UIViewController (that you can customise), and allowing you to ask for some data through their WebServices (like who are the friends, etc.). You're still inside your app.
The other app offers you a private SDK/API/WebServices
Same as the other one, but it more like a parternship. You're still inside your app.
URL Schemes
The other app gives you a few way to interact with it. They check if the app is installed, and launch it with some parameters, or if not, they may redirect it to the app in the Store, their website, etc. More info about URL Schemes from Apple Doc. You have to check their documentaion to know how to interact with it.

How to share a link from the app using other applications

I want to share a link from my app using other applications installed on my iPhone such as Gmail, Facebook, DropBox, WhatsApp etc. In android there is a straight way to do so, just fire an intent and it automatically shows the installed apps through which we can share whatever we want. Is there any such way in iPhone ?
Thanks!
On iOS , app is more separated from each other. The only way to pass data from one app to other is using the URL mechanism. As one example, an app register url scheme "open-me://",you invoked openURL with "open-me://my-link" then that app will launched. That app will define the detail of the URL so it could understand the content.Continue with the example we are using, the text you passed could be either "open-me://A?data=my-link" or "open-me://A?message=my-link". So there are no general solution for all apps.Typically third party app will provide a SDK to make these things easy.
If you don't mind using a kind of large third party library, ShareKit is a good choice. It supports quite some apps.
If you want to know more about this topic,for example sharing files between app. You could start from reading the class reference of UIDocumentInteractionController.This UI component will show a list of app installed on your device which support the URL scheme.

Possible to launch an iOS app from a web link

My app bounces the user out of the app into safari to do some web things (toying with using a webview but there are other concerns regarding layout, usage, re-launching the app, server errors, etc.). When they are done I would like a link on the final web page that lets them re-launch the app. I think this should be possible through a protocol implementation of some sort (such as href="myAppProtocol://relaunch") but I don't know how to go about implementing it properly.
[UPDATE] (can't answer my own question yet so editing here)
Stumbled across this just after posting (hours of looking and this is always how it comes together...) http://mobileorchard.com/apple-approved-iphone-inter-process-communication/
Using a URL type handler in your plist (as I suspected) you can declare that your app handles urls of that type (say "myAppProtocol"). iOS then launches your app and hands it the URL when it's touched in safari. What you do from there is up to you, I just need to launch so I don't take it any further, but you could grab the URL and parse it out for further passed information etc.
I guess you found the answer already, but have a look at the docs as well: Using URL Schemes to Communicate with Apps.

How to share data between applications?

I have previously developed on Android but never on iPhone so my question could be stupid for iPhone developers.
Does it exist one or several ways to share data between applications on iPhone ?
In Android, data sharing between applications could be performed thanks to ContentProvider.
I found a post ( How to share custom data between iPhone applications? ) that talks about URL scheme but it seems only usable to share small piece of data.
Your conclusions based on the question you linked to are correct; there's no way for iPhone applications to communicate like on Android. As mentioned, you can send information from one app to another via the URL scheme, or you may share some Keychain information amongst your own apps if you sign them properly.
No - iPhone apps are sandboxed and cannot share information. The few exceptions are that you can access information from some of the Apple apps such as the photo library, calendar, email and contacts.
It depends on what you want to share, if it is contained in a document for example, then if another application supports the document format, then you can impliment a control in your application that will allow you to open it in another app. i think it is a UIDocumentController, or UIDocumentInteractionController.
Im not 100% on the class name but good reader uses this method as does iBook, to open PDF files from another application.

Resources