Dropbox integration for iOS - ios

Is there any API method by which I can dig into all the folders of dropbox and look for a particular kind of files like a pdf or mp3 or txt? Or is there any search API in which I can pass my search parameter and ask the API to look for it every folder of dropbox. My task is to load all songs in my app from dropbox and its a real pain doing it by using the following method
[[self restClient] loadMetadata:#"/"];
and then keep on checking if the metadata is a directory or a file and if its a file then look for its extension, and if its a directory then again dig into it which can further contain more directories. I have suggested my client to have one folder for our app in which user will drop the songs but he has already denied it and wants to access whole dropbox and filter all the music files in it. I just want to get assured that its not possible before telling my client that its not possible. and if its possible then please throw some light on the procedure.

You can use Dropbox Core API directly for search:
https://www.dropbox.com/developers/reference/api#search
Dropbox iOS Sync SDK doesn't support all features of Dropbox Core API.

https://github.com/AbbieVys/WrapperDropBox
Useful wrapper class for integrating DropBox in IOS

Related

Web data storage and download services

I have an iOS app that currently uses CloudKit to store data. I want to be able to create a download link for each user that if anyone were to go to that link, they would download a piece of data (a small amount) specific to a user. I saw that CloudKit can also be used with the web using CloudKit JS but this would require me to host a server. I was also considering storing each of the user's data in a separate folder on a Dropbox account and then the download link going to that folder but I'm concerned with whether the user would be able to navigate to other folders and download other files.
Any suggestions on the best way to do this (maybe an API) would be much appreciated!

How to allow the folder to be modified by the app only?

I've a strange requirement regarding for my app which using the Google Drive SDK. I'm creating a folder and a file(Single File) through app on the Google Drive. Now I want that folder to be modified by the app only. Is this feasible?
Why I need this?
I'm writing/syncing my app data to the user's drive. I'm creating a Folder and a file on the Drive.
Now the file can be modified by the user if he visit the Drive on browser or by some other medium.
So, If the file is modified, user will not be able to access his synced data on other devices.
I do not have my own server where I can store the data.
So, I want that file should be modified by the app only. How can I do this? Is this feasible with the current SDKs available? What else are the alternatives for me to get the project done?
Please Note : I do not have my own server.
I don't think this is feasible for the reason that I haven't read anything about it in the docs nor have I seen a working implementation of it.
The closest thing I can relate to this is Permissions for Shared Files's. But the restricting of file/folder happens to both browser and native app. They're always synced.
You can set the restricted folder to Reader role. Users will only be allowed to:
-Read the metadata (e.g. name, description) of the file or folder
-Read the content of the file
-Read the list of items in the folder
Check this iOS code on how to set the permissions.

When using UIDocumentPicker, is there a way to know which external app the document is coming from?

I am using the UIDocumentPicker from iOS 8, uploading various documents from a number of different external apps such as Dropbox and Google Drive. Is there some way where I can know which app the user is getting the document from?
No. There is no API that provides this information. All you know is a temporary file URL for the selected file (when using the Import mode).

Upload files from dropbox/box account to my server using an iphone app

I have an api to upload files to my server. I need to make iphone an app to transfer files from dropbox to my server.
My question is
Do I necessarily need to download the files from dropbox/box account to iphone and then upload to my server using my api?
Or Can I skip the part of downloading the files to the device and directly upload from a dropbox/box account to my custom server?
Or Optionally keep only few files in sync between the iphone and dropbox, and upload the local copy of file to my server?
Or is there any other way of doing it?
Thanks in advance.
If the user has authorized the Dropbox API app on the iPhone app itself, and so the Dropbox API access token resides there, one solution is to have the iPhone app make an API call to /media (in the official Dropbox iOS Core SDK this is loadStreamableURLForFile). This will return a temporary direct link to the file contents. You can then pass that link to your server and do the downloading there.

App folder in Dropbox

In my application I want to fetch all audio files from Apps/App Folder using Dropbox api. I have used sync api and Datastore api but I am not able to create App folder inside 'Apps/'.
Please any one help me to find where I am wrong.
Thanks.
Once you authenticate the app within iOS it should create the folder for you, it's root dir would be '/'. As seen on their docs:
http://www.dropbox.com/developers/core/start/ios
Near the bottom? This will show you how to list all files.
EDIT:
From the link you gave me:
"With a file system in hand, you can start reading and writing files
(represented by a DBFile). If you're using the App folder permission,
your App Folder won't contain any files when a user first links with
your app, but it's easy to create one."
https://www.dropbox.com/developers/reference/devguide#app-permissions
"App folder
A dedicated folder named after your app is created within the Apps folder of a user's Dropbox. Your app gets read and write access to
this folder only and users can provide content to your app by moving
files into this folder. Your app can also read and write datastores
using the Datastore API."

Resources