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(
|
@TauriPlugin(
|
||||||
permissions = [
|
permissions = [
|
||||||
Permission(
|
Permission(
|
||||||
strings = [Manifest.permission.BLUETOOTH_CONNECT],
|
strings = [
|
||||||
alias = "bluetoothConnect"
|
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 soket: BluetoothSocket? = null
|
||||||
private var keluaran: OutputStream? = 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
|
@Command
|
||||||
fun daftarPerangkat(invoke: Invoke) {
|
fun daftarPerangkat(invoke: Invoke) {
|
||||||
if (adapter == null) {
|
if (adapter == null) {
|
||||||
|
|||||||
Reference in new issue
Block a user