You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-native-ios-volume

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-ios-volume

React Native Volume Control library for iOS

1.0.0
latest
Source
npm
Version published
Maintainers
1
Created
Source

React Native ios Volume

A library that controls 'ios device' volume.

Physical Device 'Only'

react-native-ios-volume

Getting started

$ npm install react-native-ios-volume --save

Mostly automatic installation

$ react-native link react-native-ios-volume

Manual installation

iOS

  • In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  • Go to node_modulesreact-native-ios-volume and add RNIosVolume.xcodeproj
  • In XCode, in the project navigator, select your project. Add libRNIosVolume.a to your project's Build PhasesLink Binary With Libraries
  • Run your project (Cmd+R)<

Usage


import RNIosVolume from 'react-native-ios-volume';
import React, {Component} from 'react';

class VolumeTest extends Component {
  constructor(props) {
    super(props);
    RNIosVolume.onVolumeChange = e=>{
      console.log(`onChange===${e.volume}===`);
    };
  }
  componentDidMount(){
    console.log("testing start");
    RNIosVolume.getVolume().then(e=>{
      console.log(`onGet===${e}===`);
    });
    RNIosVolume.setVolume(1);
    RNIosVolume.setVolume(0.2);
    RNIosVolume.setVolume(0.5);
  }
  
  ...
}

API

Static access to the RNIosVolume API.

Method NameDescriptionPlatform
RNIosVolume.getVolume()Get a promise that return volume .2f float valueiOS
RNIosVolume.setVolume()Set a number to your device on volumeiOS

Events

Callbacks that are invoked when a native event emitted.

Event NameDescriptionEventPlatform
RNIosVolume.onChangeVolume(event)Invoked when ios system volume is changedevent.volumeiOS

Contibutors

  • @pohsiu

  • @zxcal

Keywords

react-native

FAQs

Package last updated on 19 Jan 2018

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