Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

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
  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-ios-volume and add RNIosVolume.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNIosVolume.a to your project's Build PhasesLink Binary With Libraries
  4. 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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc