Code Monkey home page Code Monkey logo

phonegap-plugin-dropbox-chooser's Introduction

Dropbox Chooser

This is a Cordova plugin to support the Dropbox Chooser on iOS and Android. It embeds a copy of the Dropbox Chooser SDK, version 1.1 (at the time of writing), so you do not need to download it separately.

It is licensed under the MIT license - see the LICENSE file.

Prerequisites

You will need to create a app within the Dropbox App Console (https://www.dropbox.com/developers/apps/) as a developer, with the 'permission type' of 'Drop-ins'.

Cordova Local Build Installation & Configuration

Download the Dropbox Chooser package from this repository and install using the following commands:

$ cd [path_to_project]
$ cordova plugin add [directory_of_dropbox_chooser]

iOS Only

In plugin.xml you will need to insert your PhoneGap app ID for $APP_ID BEFORE adding the plugin to your project:

`<string>$APP_ID</string>`

In addition, once a Dropbox app has been created, you will be presented with an app key (viewable on the app settings page) which you will need to insert into the following tag within plugin.xml where $DROPBOX_APP_KEY is your app key:

`<string>db-$DROPBOX_APP_KEY</string>`

Note: if you attempt to compile your iOS in Xcode without these keys, it will throw an exception when you call the Chooser.

PhoneGap Cloud Build Installation & Configuration

  1. Copy the file DropboxChooser.js into your www/js assets directory.

  2. Add the following line to your index.html file:

    <script type="text/javascript" src="js/DropboxChooser.js"></script>

iOS Only

  1. Change your config.xml to add the following tags and add your Dropbox app key for [app_key] and your PhoneGap app ID for [app_id]:

    <gap:plugin name="uk.co.cv-library.plugins.DropboxChooser"> <param name="APP_ID" value="[app_id]" /> <param name="DROPBOX_APP_KEY" value="db-[app_key]" /> </gap:plugin>

Usage

Please see the app.js file within Example/www/js for a code snippet example of how to integrate this plugin with your app.

Authors

Copyright (c) 2013, 2014 CV-Library Ltd. http://www.cv-library.co.uk/

Originally developed by Mark Raymond and Tim Retout.

Please contact Tim Retout [email protected] with any feedback.

phonegap-plugin-dropbox-chooser's People

Contributors

jrschifa avatar timretout avatar tradziej avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phonegap-plugin-dropbox-chooser's Issues

infoPlist url scheme conflicts issues

I ran across a problem with this plugin.
I guess the problem is on iOS *-Info.plist, URL_SCHME conflicts with LaunchMyApp's URL_SCHEME.

I followed the guide of installation for iOS as below.
First, I installed the plugin and replaced $APP_ID, $DROPBOX_APP_KEY with my own values in plugin.xml file. Then I added cordova ios platform.

As the LaunchMyApp plugin should be installed with '--variable URL_SCHEME=xxx' option, this has to be installed after platform is added.

I found that dropbox chooser plugin overwrites target node of plist before LaunchMyApps tries to update the plist file. Strangely, launchMyApp info is not updated, after DropboxChooser has installed.

To figure out any solution, I have tried setting the info.plist file manually to have both plugins installed such as mixing those two setting values.

With setting info.plist CFBundleURLTypes like below, LaunchMyApp partially worked.
What it mean is LaunchMyApp switched app but after then url was not opened.
screen shot 2015-05-28 at 5 20 40 pm

Though I assume this two plugins conflict and tried many options, I have no luck to solve this problem.

I would appreciate if someone could help.

Error: Unable to Generate Link

I am trying to integrate your plugin in my app. I registered my app on Dropbox and got the APP Key.
As it was suggested, I inserted App key into $DROPBOX_APP_KEY
and bundle id into $APP_ID</string.

Now I am getting error Unable to Generate Link (Sorry, an error occurred. Please try again later) every time when I am clicking any file from my Dropbox list. I am wondering if my steps are correct or I've made a mistake. I can't get why this error appeared. Has anything similar ever happened to you?

Can't build Cordova project in VS2013 after adding plugin

After adding dropbox-chooser plugin to our Cordova project,
Visual Studio systematically stop running when trying to build it.
In Windows "Event viewer", we can see such stack traces:

Application : devenv.exe
Version du Framework : v4.0.30319
Description : le processus a été arrêté en raison d'une exception non gérée.
Informations sur l'exception : System.ArgumentNullException
Pile :
   à System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__5(System.Object)
   à System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
   à System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   à System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   à System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   à System.Threading.ThreadPoolWorkQueue.Dispatch()
   à System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

and:

Error Handler Exception: System.ServiceModel.CommunicationException: Une erreur s'est produite lors de la lecture du canal : Le canal de communication a été fermé. (109, 0x6d). ---> System.IO.IOException: L'opération de lecture a échoué, consultez l'exception interne. ---> System.ServiceModel.CommunicationException: Une erreur s'est produite lors de la lecture du canal : Le canal de communication a été fermé. (109, 0x6d). ---> System.IO.PipeException: Une erreur s'est produite lors de la lecture du canal : Le canal de communication a été fermé. (109, 0x6d).
   à System.ServiceModel.Channels.PipeConnection.OnAsyncReadComplete(Boolean haveResult, Int32 error, Int32 numBytes)
   --- Fin de la trace de la pile d'exception interne ---
   à System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   à System.ServiceModel.Channels.ConnectionStream.EndRead(IAsyncResult asyncResult)
   à System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
   --- Fin de la trace de la pile d'exception interne ---
   à System.Net.Security.NegotiateStream.EndRead(IAsyncResult asyncResult)
   à System.ServiceModel.Channels.StreamConnection.EndRead()
   --- Fin de la trace de la pile d'exception interne ---
   à System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   à System.ServiceModel.Channels.TransportDuplexSessionChannel.EndTryReceive(IAsyncResult result, Message& message)
   à System.ServiceModel.Dispatcher.DuplexChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
   à System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext) \r\n    à System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   à System.ServiceModel.Channels.TransportDuplexSessionChannel.EndTryReceive(IAsyncResult result, Message& message)
   à System.ServiceModel.Dispatcher.DuplexChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
   à System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext)

The android build fails with error: cannot access fragment

Hi,

When I am building for android targetsdk=22 from command line, the build fails with an error:

platforms/android/src/uk/co/cv_library/plugins/DropboxChooser.java:46: error: cannot access Fragment

.launch(cordova.getActivity(), DBX_CHOOSER_REQUEST);
^
class file for android.support.v4.app.Fragment not found

This is preventing me to use the plugin. Incase of IOS the plugin works fine.

iOS asks to Install Dropbox when already installed

Looks like it works for android, but for iOS when calling the dropbox chooser I keep getting the Install Dropbox screen, and while I hit 'Open' from the app store since I already have it it just goes to the Dropbox App and not getting the chooser widget.

Unable to download files

The plugin has suddenly stopped working. The Dropbox app opens and you can browse to the file but the download action crashes the app on Android and shows the unable to generate link error on iOS.
Has Dropbox changed its API or SDK recently?

As per the latest pull

The plugin crashes on both android and ios,

is there something that I am doing wrong?

Error: WARNING multiple Dropbox url schemes found in Info.plist

I imagine this is the error you mentioned in the README.md

I'm working locally on iOS7, I've populated APP ID and APP KEY in the plugin.xml, but unfortunately still getting the error.

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'DBChooser: WARNING multiple Dropbox url schemes found in Info.plist. Please use the method -initWithAppKey: instead.'

Not sure if this this a bug or just me not getting it.

Thanks a lot for the plugin. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.