Menambah fungsi untuk cek dan minta izin
This commit is contained in:
1 parent
44cc5a3fb3
commit
b7ceeccb52
1 file changed
+16
-2
@@ -27,8 +27,12 @@ class KirimArgs {
|
||||
@TauriPlugin(
|
||||
permissions = [
|
||||
Permission(
|
||||
strings = [Manifest.permission.BLUETOOTH_CONNECT],
|
||||
alias = "bluetoothConnect"
|
||||
strings = [
|
||||
Manifest.permission.BLUETOOTH_SCAN,
|
||||
Manifest.permission.BLUETOOTH_CONNECT,
|
||||
Manifest.permission.BLUETOOTH_ADVERTISE
|
||||
],
|
||||
alias = "bluetooth"
|
||||
)
|
||||
]
|
||||
)
|
||||
@@ -39,6 +43,16 @@ class BluclasPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
private var soket: BluetoothSocket? = null
|
||||
private var keluaran: OutputStream? = null
|
||||
|
||||
@Command
|
||||
override fun checkPermissions(invoke: Invoke) {
|
||||
super.checkPermissions(invoke)
|
||||
}
|
||||
|
||||
@Command
|
||||
override fun requestPermissions(invoke: Invoke) {
|
||||
super.requestPermissions(invoke)
|
||||
}
|
||||
|
||||
@Command
|
||||
fun daftarPerangkat(invoke: Invoke) {
|
||||
if (adapter == null) {
|
||||
|
||||
Reference in new issue
Block a user