package com.solinor.bluetoothstatus;

import android.bluetooth.BluetoothAdapter;

import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.Callback;

public class RNBluetoothManagerModule extends ReactContextBaseJavaModule {

    private final ReactApplicationContext reactContext;

    private BluetoothAdapter btAdapter;

    public RNBluetoothManagerModule(ReactApplicationContext reactContext) {
        super(reactContext);
        this.reactContext = reactContext;
        btAdapter = BluetoothAdapter.getDefaultAdapter();
    }

    @Override
    public String getName() {
        return "RNBluetoothManager";
    }

    @ReactMethod
    public void getBluetoothState(Callback callback) {
        boolean isEnabled = false;
        if (btAdapter != null) {
            isEnabled = btAdapter.isEnabled();
        }
        callback.invoke(null, isEnabled);
    }

    @ReactMethod
    public void setBluetoothOn(Callback callback) {
        if (btAdapter != null) {
            btAdapter.enable();
        }
        callback.invoke(null, btAdapter != null);
    }

    @ReactMethod
    public void setBluetoothOff(Callback callback) {
        if (btAdapter != null) {
            btAdapter.disable();
        }
        callback.invoke(null, btAdapter != null);
    }
}
@@ -283,16 +283,132 @@
 llback;%0A
+import com.facebook.react.module.annotations.ReactModule;%0A%0A@ReactModule(name = RNBluetoothManagerModule.MODULE_NAME)
 %0Apublic 
@@ -476,16 +476,77 @@
 dule %7B%0A%0A
+    final static String MODULE_NAME = %22RNBluetoothManager%22;%0A%0A
     priv
@@ -906,36 +906,32 @@
  return 
-%22RNBluetoothManager%22
+this.MODULE_NAME
 ;%0A    %7D%0A

Add module annotation