/**
* Asks to enable bluetooth
*/
@ReactMethod
public void enableBluetooth(final Promise promise) {
try {
if (!checkBluetooth()) {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
getReactApplicationContext().startActivityForResult(enableBtIntent, NEAR_BLUETOOTH_SETTINGS_CODE, new Bundle());
}
promise.resolve(true);
} catch (Exception e) {
promise.reject("BLE_ACTIVATION_ERROR", e.getMessage());
}
}
RNConnectivityStatusModule.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:react-native-connectivity-status
作者:
评论列表
文章目录