Is there a way to send content from my app, which is not from my app? - ios

I have a theoretical question to the file system/restriction from iOS.
In an Android app I can open a file from filesystem, with my app, and send it via mail or send it to a REST-service.
This is not possible under iOS, because there is no filesystem like under Android.
As far as I know I can only send file, which are created by my app.
Is there a way to send content from my app, which is not from my app?
For example a pdf received per mail, opened in my app and send it to a server or something else.
best regards

Yes, you can make your app eligible to open specific type of files ( images, videos, pdf, docs, etc )
see https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/RegisteringtheFileTypesYourAppSupports.html
After that you bring the url file and you can work on it locally into your app, or uploading the linked file on a server as well

Related

How to allow user to upload attachments in iOS application

In case of Android when I want to send or attach a document such as a pdf or doc from my application I can easily access all the files in the external storage and share or attach.
But since iOS follows a sandbox approach as well as there is no filesystem so it is not possible to attach or upload in same manner.
In my iOS application right now, I have implemented Open In functionality, wherein in the info.plist file I have specified that my application supports all types of documents so when the user opens any documents he gets an option to Open In my application, then I save that document in the
Documents/Incoming
folder in the application, now when my user clicks to add attachment then he can see the document to attach, since this is a long process I was looking for better ones.
I saw whatsApp allows uploading/sharing from iCloud apart from that what can I do to provide a similar behaviour as Android.

Upload files from dropbox/box account to a public cloud using an iphone app

I need to transfer files from the drop box account directly to a public cloud without downloading the files and storing it in the application sandbox. Does Apple allow this?
I am looking at the same and did not find it. It should not be due to Apple allowing or not; but dropbox app does not have the function. E.g. to send a photo from dropbox, sharing function only sends a link in my apple mail.
Only possible solution I am exploring is using airfile (not sure of other apps AFAIK now), clicking on sharing allows me to open it in other app (buggy 4 my test nw) or to send via email.. send via email sounds ok since i can select photos in airfile, see the actual pic in the apple mail and send it via to flickr.
Hope that idea helps!

Phonegap 3.0+ How to print a document and/or send it to another device via email/airdrop/etc without using Mobile Safari

I'm working on a Phonegap 3.1 iOS app.
What I have currently:
I'm using the InAppBrowser plugin to view user-uploaded documents from a server.
The document types users upload are commonly (but not limited to) the following:
.pdf
.png, .gif, .jpeg
.xls, .doc, .ppt
.txt
What I want to do:
Viewing the files works well in the InAppBrowser, but now I am exploring ways that users could send the documents to each other.Mobile Safari has a share button that allows a user to send a file by airdrop, message, mail, tweet, facebook or airprint. I cannot, however, use Safari since it is a non-negotiable requirement that I do not expose the URL where these files are hosted.
The InAppBrowser allows me to hide the location from the user, which is not possible with Mobile Safari. I want to be able to email and print a document without ever exposing the url where that document lives.
Is it possible to create the same sharing mechanism from within a Phonegap app?
What I know so far
I'm aware of the Phonegap File plugin for uploading and downloading files.
If I were to download a file from the server so it was stored locally, how would I go about making it shareable (through email, airdrop, etc)?
From what I can tell, there are no relevant Phonegap 3.0+ compliant plugins to achieve this so I would think I need to create my own. Am I on the right track?

forcing a file to open in predefined application in iOS

I am trying a simple web app which downloads files from internet and saves on iPad. Theses files are of .pdf,.xls,.doc, etc format. Now, I want to assign a default application to open a specific file type. (Say Adode reader for pdf file, Some image viewer app for image files etc). I dont want my app/os to decide which app the file should open in. Instead, if assigned app doesnt exists then it should give me a message that no such app found. Is it possible to do?
With a web app you cannot do such things.
If you go native, you can use Custom URL Schemes (see http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html)
But with Custom URL Schemes, you only are able to pass a view parameters. If you want more, UIPasteboard is recommended.
Apps are sandboxed. You cannot access other apps, nor their data!!!
But on native apps you can pass over data with pasteboard, call a custom url handler, pass a few parameters to cause the other apps to process your data.
Often App developers, like camera+ offer a documentation for the usage of their custom url schemes (Camera+ URL Schemes API)

PhoneGap/Cordova and external url instead of www/index.html

I'm about to build and app with Cordova.js to enable file upload on the iPhone. I'd like to just use the regular responsive web site and include the cordova.js to get access to native features like the camera.
I read somewhere that Apple might reject apps that loads external urls in an app like this. Is this true and what's the real problem?
Would it be different if the app contains a local page by default and opens external content on user interaction?
Well if you app can be reproduced by a web site then Apple will just reject it. You are going to add camera features so that is a good start. If you don't use some native features they will reject it out of hand.
Secondly Apple does not like apps that load code from remote locations. They want to be able to go over everything themselves and don't like the idea of things changing without them being able to verify it first. So, remote data is okay but remote code is not in their eyes.

Resources