Adding a 'save to' location to Pages on iPad - objective-c

I know that it is possible to use UIDocumentInteractionController to give the user a chance to open a document, say a Word document, in an application such as Pages.
Is it possible in any way to do the reverse: that is, allow a user to save the document back to an area where my application can access the newly saved document, or to provide a 'save to' option within Pages? Like how Dropbox integrates with Pages.
Thanks

Unfortunately no. Apps that support Dropbox do so by implementing the Dropbox API and syncing to the Dropbox server when online. The only way another app can give a file to your app directly is through the UIDocumentInteractionController "Open in.." feature. You can sign up for receiving files of the formats you want to support like this: those files will be written temporarily in your app bundle's Documents/Inbox and you will have to save them in another directory to be able to write to them.

This is not possible. You can't save apps to other application's space due to required app sandboxing.

Related

iPhone: bulk move ALL voice memos + ALL pdfs generated from Safari page prints (pdf-exports using "Books") to pc

voice memos:
I have 100s of voice memos that I recorded using the Apple voice recorder standard app and I want to get them on my pc altogether in one go.
pdfs:
I often save mobile Safari pages as Books which are then automatically saved (very quickly and well-formatted) as pdfs. On a website opened in Safari, you can choose the "send to"- button and then the orange Symbol for books. I have houndreds of self-generated pdfs in ibooks, and I have googled and tested for a longer time how to transfer them to my pc (see the details of these tests in the answer section).
Is there any trick to bulk move ALL voice memos in just one go + ALL pdfs in Books to the pc in just one go? I am happy about ANY way to reach this.
Please mind: I do not want to save every voice memo / pdf, piece by piece, in a cloud or app nor send each of them, piece by piece, by mail. This costs too much time and nerves and is not a bulk move.
I found a working solution in Decipher Backup Browser 14. This program might not be the only one achieving the aim, but it does the thing. Whoever finds other programs, please add an answer.
It simply reads out the data from the iPhone backup that you can create with iTunes. The program offers extracting all voice memos, as well as extracting all PDFs in "All PDFs in Backup". In the full version, you can then save them in one go to your pc. Thanks go to the pragmatic e-mail help including the screenshot.
Another possible solution perhaps is to sync your iBooks with iCloud - perhaps, because there is no working test, neither on Windows nor on macOS.
#### Testing the sync of the Safari pdfs:
(I originally got the info of the possible sync on macOS from the Decipher company, but I assume this is a simple misunderstanding or outdated.)
I sync iBooks with iCloud, iBooks are part of iCloud's "Manage Storage" option in my iPhone Settings, and still I do not see the pdfs there. On Windows, I do not see any iBooks sign at all in iCloud. iBooks is supposed to be hidden in iCloud Drive according to https://apple.stackexchange.com/questions/296462/locating-the-ibooks-folder-in-icloud-drive?newreg=1d6ae7995129403b99e57fe74feae430, but I could not succeed with the help of that link, the answers there are for Apple macOS command line (macOS bash). Then an additional investigation turned out that even if there were a hidden folder on Windows (which does not), it would not help: #ankii was so kind to test this on macOS, the needed pdfs cannot be seen in the macOS hidden iBooks folder either. See https://apple.stackexchange.com/questions/395290/locating-the-ibooks-folder-in-icloud-drive-on-windows, #ankii:
I exported a wikipedia page to iOS iBooks, as pdf. It shows up on iOS
app. but not on Mac app. that is weird.
Please, if anyone has managed this iCloud sync on Windows or macOS, answer here, but it seems as if there is no solution.
####
The simple reason why all of the normal file transfer tools cannot help, but only those which give you the contents of the iTunes backup, is because the needed pdfs ARE only in the backup. :)
When you delete such a "Safari-pdf", it will ask you whether you want to delete this from iCloud or if you only want to delete it from the downloads. That is just the standard question for the real e-books, while the "Safari-pdfs" that this thread is about are not part of iCloud anyway.
And it seems as if this will not change in the future, according to https://discussions.apple.com/thread/251534441 discussion results.
##################### Finally:
After having saved all of the PDFs, deleting them in two alternatives:
Books > Library > Edit > "Select All" on the left (you may also do this inside a specific collection only so that you can filter what you want to delete, you can also multi-select PDFs manually instead of "Select All")
or delete all by going to Settings --> Passwords & Accounts --> iCloud --> iCloud --> Manage Storage --> Apple Books (mind there are 2 of them, take the first one) --> Delete Documents & Data
#
#
#
Additional documentation
##########################################################################
Proof that the bulk move cannot be done without a 3rd party app.
I have tried several 3rd party programs to transfer the pdfs, but none of them find the Safari pdf prints, they only find just the commercial e-books. iTunes does not find them either.
I was asked by a moderator to move the details of what I have already tried to reach a bulk move - and which were at first part of the question - to this answer. This was tested in 04/2020, but the problem will still be the same.
##########################################################################
iPhone 7, iOS 13.4.1 transfer iBooks pdfs to Windows 10
either with 3rd party apps or iTunes v. 12.10.5.12
result: nothing works, only workaround is using Adobe Acrobat or
iCloud Drive going through each single pdf
Unsuccessful try only using iBooks and iTunes:
In iTunes, clicking on your phone symbol, the iTunes pane that appears has a lot of options like overview, music, films... and also third party apps like kindle or acrobat in the last menu point, but there is no iBooks anywhere.
In the main menu, iBooks folder is empty. Right-click on iBooks and "transfer purchases" leads to nothing, of course: I have not bought any pdf, but just printed it from safari. In the settings, in "iTunes and App Store" make sure that "iBooks and audiobooks" are switched on for automatic download.
Third party apps fail to show iBooks' Safari pdf prints:
Tested up to now (few of so many): iMazing, iExplorer, easeus, ApowerManager, Phonepaw, iTools 4.4.5.8
Only those pdfs that you had actually added from the pc to the phone
are also in the books folder in the third party apps.
Those pdfs that are just printed pdfs from safari websites do not appear in the third party apps of iTunes.
iCloud Drive or Adobe Acrobat app: The current workaround which takes too much time and nerves:
Adobe Acrobat v. 20.04.00 app on the iPhone, click on every pdf's 3 dots in the overview in iBooks, save it in Acrobat. Then use iTunes, clicking on your Phone symbol, use the last menu point to get to Acrobat 3rd party app and then mark all pdfs and save them to a folder on your pc.
You can also use iCloud Drive, AirDrop or the like, works the same and does not need iTunes. Make sure that in your iPhone preferences, iBooks --> iCloud Drive is switched on (this is the standard anyway). Still the same issue with any such solution: no bulk move possible.
In Books, use the "Save to Files" option. Afterwards, follow these directions.

I want to copy the file in sandbox without NSOpenPanel

I want to copy some files to specified folder by NSOpemPanel.
The source file is reading from XML and show to list in NSTable.
I can copy file by copyItemAtPath.
But now my app will turn to sandbox, then I can’t copy the file by copyItemAtURL.
How do I copy the file in sandbox mode?
I was looked over a lot of post. And I think the Security-scoped Bookmark may be a solution for this.
But I can’t create "Security-scoped Bookmark" from XML inside the path (the path was convert to NSURL ready).
I was setting to sandbox.entitlements but it's not clear this problem.
Is there any way for this?
Develop in macOS10.12 and Xcode8.3.3
Thanks
How do I copy the file in sandbox mode?
It is unclear what your current code is doing, but the rules under the sandbox are simple: To read or write a file located outside of an application's own container (which is hidden away under the Library folder) your application must either:
Use NSOpenPanel to obtain a URL from the user for the file path; or
Use NSOpenPanel to obtain a URL from the user for one of the ancestor folders of the file.
The second option gives access to a whole folder, including any sub-folders; i.e. the whole file/folder subtree rooted in the folder.
As you want to copy "some files" it sounds like asking the user for permission for the folder is appropriate. You can customise the NSOpenPanel to be a "request permission" dialog. If you are requesting a specific folder you can also have the dialog open in it's containing folder and only have the specific folder enabled for selection by the user.
Once you have the URL for the folder from NSOpenPanel you can create a security scoped bookmark for it and save that in your app's preferences or other configuration file (stored within the app's container). Doing this enables your app to regain access to the folder on subsequent executions without asking the user again.
If after investigating this issue and writing some code you hit an issue ask a new question, showing your code, and explaining the problem. Someone will undoubtedly help you with the next step.
HTH

How to find the "Saved Pictures" folder in OneDrive?

When you save a picture in Windows Phone (browse the web and save a picture from any website), it is automatically saved to a "Saved Pictures" folder (local) and uploaded to a "Saved Pictures" folder in OneDrive.
I'm trying to create an app which is able to save pictures to OneDrive, and I want to save to that folder.
Is there a way to find that folder?
I know some folders (Camera roll, documents, etc.) have friendly names (/me/skydrive/camera_rol, /me/skydrive/my_documents, etc.). Is there some name to this Saved Pictures? Or is it specific to Windows Phone (Windows Phone creates it).
Thanks in advance.
UPDATE: in case you are wondering, what I'm trying to do is to develop the Chrome extension I suggested in UserVoice.
Using the new Onedrive API, there is a way to get access to "special folders", and there is a undocumented folder named "savedPictures", but it doesn't work.
I raised an issue in their bugtracker and they told me would be fixed.
Once it gets fixed, the right way to access the Saved Pictures folder will be to
GET /drive/special/savedPictures
Unfortunately I don't believe the "Saved Pictures" folder is accessible via this mechanism, and on top of that here isn't an easy way to find it yourself since it can be moved and renamed by users.

creating a file upload function with titanium

I'm supposed to develop a mobile app for moodle using android on titanium studio. And I have been searching for days for any helpful article on how to get a file chooser dialog to work on android. Most of the tutes offer image upload but I need to upload .pdf and zip files from mobile. I have already tried fileChooserDialog() and folderChooseDialog() to no avail. Help please?
There isn't a file chooser out of the box, as apps usually send files to each other internally. You can roll your own using ListViews though easily..
Build a list of all the files you're interested in. (https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Filesystem.File-method-getDirectoryListing)
Loop through the list omitting any file types you don't want and build the list
When the user selects a file capture the click event and upload that file.
Style however you want..

Retrieving Spotlight query used to open document in application

If you search for something that opens Preview.app (e.g. a PDF file) in Spotlight, the application not only opens the file but actually copies the Spotlight query into the application's search field (for deeper search). iPhoto and Mail.app also do this.
This is a really nice feature. Unfortunately, Apple does not document how it's implemented. Opening a document from Spotlight appears to simply send application:openFile to the application delegate. Is it possible to retrieve the user's Spotlight query somehow? Or is this a hardcoded feature of Spotlight?
If you're looking for the term used in the query, keyAESearchText will work (see listing 10-1). So yes, they document it, but not in the expected place. File an enhancement request at the bottom of the page.