🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

react-native-photo-viewer

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-photo-viewer

React native photo viewer component, used for Android, iOS.

1.2.3
latest
Source
npm
Version published
Weekly downloads
4
100%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-photo-viewer

React native photo viewer component for Android, iOS

Table of contents

  • Install
  • Usage

Install

npm install react-native-photo-viewer --save

Use rnpm to automatically complete the installation:
rnpm link react-native-photo-viewer

or link manually like so:

Android

// file: android/settings.gradle
...

include ':react-native-photo-viewer'
project(':react-native-photo-viewer').projectDir = new File(settingsDir, '../node_modules/react-native-photo-viewer/android')
// file: android/app/build.gradle
...

dependencies {
    ...
    compile project(':react-native-photo-viewer')
}
// file: android/app/src/main/java/com/<...>/MainApplication.java
...

import com.wog.photoviewer.PhotoViewerPackage;; // <-- add this import

public class MainApplication extends Application implements ReactApplication {
    @Override
    protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new PhotoViewerPackage() // <-- add this line
        );
    }
...
}

Usage

Android

var PhotoViewerManager = require('react-native-photo-viewer');

/**
 * The method will launch native module
 * @param {String} url Video link
 */
PhotoViewerManager.showPhotoViewer(url);

iOS

var PhotoViewer = require('react-native-photo-viewer');

/**
 * This component will be used as Control, embeded inside a Viewer
 */
 <PhotoView
 source={{uri: [URL]}}
 minimumZoomScale={1} // min scale
 maximumZoomScale={4} // max scale
 .../>

Keywords

react-native-component

FAQs

Package last updated on 26 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts