react-native-media-monitor
TypeScript icon, indicating that this package has built-in type declarations

0.0.14 • Public • Published

react-native version

react-native-media-monitor

Monitor your Media with React Native

Installing the library

$ npm install react-native-media-monitor

Linking

On iOS, the CameraRoll API requires the RCTCameraRoll library to be linked. You can refer to Linking Libraries (iOS) to learn more.

Permissions

The user's permission is required in order to access the Camera Roll on devices running iOS 10 or later. Add the NSPhotoLibraryUsageDescription key in your Info.plist with a string that describes how your app will use this data. This key will appear as Privacy - Photo Library Usage Description in Xcode.

If you are targeting devices running iOS 11 or later, you will also need to add the NSPhotoLibraryAddUsageDescription key in your Info.plist. Use this key to define a string that describes how your app will use this data. By adding this key to your Info.plist, you will be able to request write-only access permission from the user. If you try to save to the camera roll without this permission, your app will exit.

Usage Example

import React, { Component } from "react";
import { MediaMonitor } from "react-native-media-monitor";

MediaMonitor.configure(MediaMonitor.createConfiguration({ first: 5 })); // default configuration (optional)

export default class App extends Component {
    componentDidMount() {
        MediaMonitor.start(
            media => {
                this.setState({ media }, () => console.log(media));
            }
        )
    }
}

Contributing

All contributions are very welcome.

Before make a Pull Request please run the linter.

$ npm run lint

Licence

The MIT License

Copyright (c) 2018 LYOS

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in

Package Sidebar

Install

npm i react-native-media-monitor

Weekly Downloads

1

Version

0.0.14

License

MIT

Unpacked Size

16.2 kB

Total Files

35

Last publish

Collaborators

  • jccarrillo