1.0.0-beta.0 • Published 4 years ago

@anarock/react-native-cloudinary v1.0.0-beta.0

Weekly downloads
1
License
Apache-2.0
Repository
-
Last release
4 years ago

react-native-cloudinary

Getting started

$ npm install react-native-cloudinary --save

Mostly automatic installation

$ react-native link react-native-cloudinary

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.pranjal.RNCloudinaryPackage; to the imports at the top of the file
  • Add new RNCloudinaryPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-cloudinary'
    project(':react-native-cloudinary').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-cloudinary/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-cloudinary')

Usage

import RNCloudinary from 'react-native-cloudinary';

try {
 const uploadRequest = await RNCloudinary
  .init(filePath)
  .setOptions(options) // Set cloudinary options (Optional)
  .setPolicy(policy) // Set upload policy options (Optional)
  .setListeners({
    onStart: () => { // Do something on upload start },
    onProgress: (bytes, totalBytes) => { // Show upload progress },
    onSuccess: () => { // Do something on success },
    onError: (e) => { // Handle upload time error }
  })
  .dispatch()
} catch (e) {
  // Handle init error
}




uploadRequest.clearListeners() // Clears listeners
1.0.0-beta.0

4 years ago

0.2.0

6 years ago

0.2.0-alpha.3

6 years ago

0.2.0-alpha.2

6 years ago

0.2.0-alpha.1

6 years ago

0.1.2-alpha.6

6 years ago

0.1.2-alpha.5

6 years ago

0.1.2-alpha.4

6 years ago

0.1.2-alpha.3

6 years ago

0.1.2-alpha.2

6 years ago

0.1.2-alpha.1

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago