Skip to content

Commit

Permalink
V 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
c19354837 committed Feb 24, 2018
1 parent ea8833b commit 9420f61
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
method | description
------ | -----------
**Volume**|
getVolume(type:string) => Promise | Get the system volume. <br><br>`type` must be one of `'music', 'call', 'system', 'ring', 'alarm', 'notification'`, default is `music`
setVolume(val:float, type:string) | Set the system volume by specified value, from 0 to 1. 0 for mute, and 1 is max volume.<br><br>`type` must be one of `'music', 'call', 'system', 'ring', 'alarm', 'notification'`, default is `music`
getVolume(type:string) => Promise | Get the system volume. <br><br>`type` must be one of `music`, `call`, `system`, `ring`, `alarm`, `notification`, default is `music`
setVolume(val:float, config:object) | Set the system volume by specified value, from 0 to 1. 0 for mute, and 1 is max volume.<br><br> `config` can be `{type: 'music', playSound:true, showUI:true}`<br><br> `type` : must be one of `music`, `call`, `system`, `ring`, `alarm`, `notification`, default is `music`.(Android only) <br>`playSound`: Whether to play a sound when changing the volume, default is `false`(Android only)<br>`showUI`: Show a toast containing the current volume, default is `false`(Android & iOS)<br><br> **since 1.2.2**
addVolumeListener(callback) | Listen the volume changing, and it will return the listener. More info see [the example](https://github.com/c19354837/react-native-system-setting/blob/master/examples/SystemSettingExample/index.js#L42)
removeVolumeListener(listener)| Remove listener when it no longer needed.
---|---
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# V1.2.2
**2018-02-25**

use `MPVolumeView` to get/set volume for iOS.

change API `setVolume(val, type)` to `setVolume(val, config)`, see [detail](https://github.com/c19354837/react-native-system-setting/issues/15)

# V1.2.1
**2018-01-21**

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const volumeListener = SystemSetting.addVolumeListener((data) => {
SystemSetting.removeVolumeListener(volumeListener)
```

> For Android, you can change volume by type, default is `music`, [more detail](https://github.com/c19354837/react-native-system-setting/blob/master/API.md)
> `setVolume` can do more, [more detail](https://github.com/c19354837/react-native-system-setting/blob/master/API.md)
**brightness**

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-system-setting",
"version": "1.2.1",
"version": "1.2.2",
"description": "provide some system setting APIs. Volume, brightness, wifi, location, bluetooth, airplane...",
"main": "SystemSetting.js",
"homepage": "https://github.com/c19354837/react-native-system-setting",
Expand Down

0 comments on commit 9420f61

Please sign in to comment.