npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-dropbox-chooser

v3.0.0

Published

React Native dropbox chooser module

Downloads

18

Readme

react-native-dropbox-chooser

What is this?

For more details check out https://www.dropbox.com/developers/chooser#ios for an explanation.

Only Works On Device

This will only work on Device. This will open up a window prompting you to install the Dropbox app on the Simulator.

Install

npm install react-native-dropbox-chooser --save

Sign up

You'll need to sign up and get an app key from Dropbox.

First go here https://www.dropbox.com/developers/apps/create.

  • Select "Dropbox API"
  • Select what you need access to
  • Name your app
  • Agree to TOS
  • Submit

You'll see a section where it says "App key" and a series of numbers/letters. We'll need this in a second.

Setup

First off add it to your project. How to link native modules can be found here. http://facebook.github.io/react-native/docs/linking-libraries-ios.html#content.

This will use LinkingIOS so we'll need to add this code to your AppDelegate.m

At the top of the file you will need to add #import "RCTLinkingManager.h"

Should look like

#import "AppDelegate.h"

#import "RCTRootView.h"
#import "RCTLinkingManager.h"

Then before the @end you need to add this code.

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
  return [RCTLinkingManager application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
}

Explanation can be found here https://facebook.github.io/react-native/docs/linkingios.html#content.

This will now start complaining that RCTLinkingManager doesn't exist.

We'll need to add header search paths for the Libraries. Go to Build Settings, find Header Search Paths, and add $(SRCROOT)/../node_modules/react-native/Libraries. Set it to recursive.

Because we are using the chooser we'll need to add the below configuration to the Info.plist What this will allow us to do is throw over the the Dropbox app and have it send us the links back.

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>dbapi-1</string>
  <string>dbapi-3</string>
</array>

Now go to the Info tab.

At the bottom it will have a section called URL Types. Open it and press the +.

Add db-APPKEYHERE into the URL Schemes input box.

How to use

Require the module.

var DropboxClient = require('react-native-dropbox-chooser');
  componentDidMount() {
    DropboxClient.init({
      appId: 'YOURAPPIDHERE',
      onFiles: this.handleFiles //Callback that receives file(s) when they are selected
    });
  },

  componentWillUnmount() {
    DropboxClient.remove(); //Don't forge to remove it
  },

Done

We should be good to go!