GithubHelp home page GithubHelp logo

rn-cloudinary-demo's Introduction

rn-cloudinary-demo

This is a react-native IOS module to interact with the Cloudinary APIs for Image and Video management.

Sample Useage:

var React = require('react-native');
var {
  AppRegistry,
  StyleSheet,
  DeviceEventEmitter, // <== Must Include !!
  Text,
  View,
} = React;

// Load Up our Native Module..
var {
    RNCloudinary
} = require('NativeModules');


// List for progress updated from the upload
var subscription = DeviceEventEmitter.addListener(
  RNCloudinary.ProgressEvent,
  (progressInfo) => console.log(progressInfo)
);

// call function with callback
RNCloudinary.uploadImage("", function(_response){
  console.log(JSON.stringify(_response,null,2));


  // Don't forget to unsubscribe, typically in componentWillUnmount
  subscription && subscription.remove();

});

Successful Output:

2015-05-14 23:23:46.923 [info][tid:com.facebook.React.JavaScript] "{
  "success": true,
  "result": {
    "version": 1431660226,
    "resource_type": "image",
    "bytes": 829971,
    "created_at": "2015-05-15T03:23:46Z",
    "width": 3872,
    "tags": [],
    "url": "http://res.cloudinary.com/clearly-innovative-inc/image/upload/v1431660226/vrxsddvzxm5fzxzqj5k2.jpg",
    "type": "upload",
    "signature": "e9b8f9e041b25d91b2dde06224ea48f007c2448c",
    "public_id": "vrxsddvzxm5fzxzqj5k2",
    "height": 2592,
    "format": "jpg",
    "secure_url": "https://res.cloudinary.com/clearly-innovative-inc/image/upload/v1431660226/vrxsddvzxm5fzxzqj5k2.jpg",
    "etag": "fc7dc48d44fc9e239de229415a458efe"
  },
  "publicId": "vrxsddvzxm5fzxzqj5k2"
}"

Progress Response from Event Subscription:

2015-05-14 23:23:46.256 [info][tid:com.facebook.React.JavaScript] {"bytesWritten":"32768","totalWritten":"688128","totalExpected":"830410"}
2015-05-14 23:23:46.272 [info][tid:com.facebook.React.JavaScript] {"bytesWritten":"32768","totalWritten":"720896","totalExpected":"830410"}
2015-05-14 23:23:46.289 [info][tid:com.facebook.React.JavaScript] {"bytesWritten":"32768","totalWritten":"753664","totalExpected":"830410"}
2015-05-14 23:23:46.306 [info][tid:com.facebook.React.JavaScript] {"bytesWritten":"32768","totalWritten":"786432","totalExpected":"830410"}
2015-05-14 23:23:46.323 [info][tid:com.facebook.React.JavaScript] {"bytesWritten":"32768","totalWritten":"819200","totalExpected":"830410"}
2015-05-14 23:23:46.323 [info][tid:com.facebook.React.JavaScript] {"bytesWritten":"11210","totalWritten":"830410","totalExpected":"830410"}

Current Status

  • basic module completed with hard coded sample file
  • pass in configuration API keys in initialization
  • allow user to pass in file name for image/video upload
  • allow user to pass in base64 encoded string for image
  • support cloudinary url api for image/video manipulation

rn-cloudinary-demo's People

Contributors

aaronksaunders avatar

Watchers

James Cloos avatar Marcel S. avatar

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.