Skip to content

Commit

Permalink
V1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
c19354837 committed Apr 23, 2018
1 parent 532e4b2 commit e5c3d4b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 6 additions & 3 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ grantWriteSettingPremission()| open app setting page. It's user-friendly when yo
saveBrightness()|It will save current brightness and screen mode.
restoreBrightness() => Promise|Restore brightness and screen mode back to saveBrightness(). While iOS only restore the brightness, Android will restore both. <br><br>You should call this before setBrightness() or setBrightnessForce(). <br><br>It will return the saved brightness.
---|---
setAppStore(isAppStore:bool)| `true` means that you'll submit your app to App Store. In order to throught the App Store review, it has some side effects, see [App Store](https://github.com/c19354837/react-native-system-setting#app-store).<br><br>`false` means that your app will not upload to App Store, and you can use any APIs at will.
---|---
**Wifi**|
isWifiEnabled():Promise|Get wifi state, true if wifi is on.
switchWifi(complete)|It will open **Wifi Setting Page**, and you can change it by yourself. When come back to the app, the `complete` will be call.
switchWifiSilence(complete)|It will open wifi if the wifi is off, and close wifi when the wifi is on now. When it has done, the `complete` will be call.<br/>In android, it's done programmatically. <br><br>In iOS, I cannot do that by code for system limiting, so it just calls `switchWifi(complete)`<br><br>You need declare `android.permission.CHANGE_WIFI_STATE` in your AndroidManifest.xml, see [detail](https://github.com/c19354837/react-native-system-setting#powerful-api)
addWifiListener(callback):Promise| Listen the wifi state changing, and it will return the listener. (Android only)
---|---
**Location**|
isLocationEnabled():Promise|Get location state, true if location is on.
Expand All @@ -39,8 +38,12 @@ switchLocation(complete)|It will open **System Location Setting Page**, and you
isBluetoothEnabled():Promise|Get bluetooth state, true if bluetooth is on.
switchBluetooth(complete)|It will open **System Bluetooth Setting Page**, and you can change it by yourself. When come back to the app, the `complete` will be call.
switchBluetoothSilence(complete)|It will open bluetooth if the bluetooth is off, and close bluetooth when the bluetooth is on now. When it has done, the `complete` will be call.<br/>In android, it's done programmatically. <br><br>In iOS, I cannot do that by code for system limiting, so it just calls `switchBluetooth(complete)`<br><br>You need declare `android.permission.BLUETOOTH_ADMIN` in your AndroidManifest.xml, see [detail](https://github.com/c19354837/react-native-system-setting#powerful-api)
addBluetoothListener(callback):Promise| Listen the bluetooth state changing, and it will return the listener.
---|---
**Airplane**|
isAirplaneEnabled():Promise|Get airplane state, true if airplane is on.
switchAirplane(complete)|It will open **System Setting Page**, and you can change it by yourself. When come back to the app, the `complete` will be call.

---|---
**Other**|
setAppStore(isAppStore:bool)| `true` means that you'll submit your app to App Store. In order to throught the App Store review, it has some side effects, see [App Store](https://github.com/c19354837/react-native-system-setting#app-store).<br><br>`false` means that your app will not upload to App Store, and you can use any APIs at will.
removeListener(listener)| you can use this to remove the listener which return by `add*Listener(callback)`
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# V1.4.1
**2018-04-23**

new API: `addWifiListener()`, only works in Android

new API: `addBluetoothListener()`, Android & iOS

# V1.4.0
**2018-04-21**

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.4.0",
"version": "1.4.1",
"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 e5c3d4b

Please sign in to comment.