PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV Mobile 2024 → Problem with bluetooth permissions
Problem with bluetooth permissions
Iniciado por Daniel, 13,nov. 2023 18:52 - No hay respuesta
Publicado el 13,noviembre 2023 - 18:52
Friends, good morning.

My question is; do you know if WinDev Mobile has any function to reset the global state of an app after any special process. For example, I have an app that needs special bluetooth permissions such as android.permission.BLUETOOTH_CONNECT and android.permission.BLUETOOTH_SCAN. Now, these permissions are requested exactly after the splash screen of the app on the main screen. But a situation happens, and is that when trying to use a bluetooth printer apparently the app is not able to recognize that the permissions are already approved, so it generates an error in which indicates that any of those permissions that I mentioned is not approved by consequence generates a fatal error that closes the app, but when I open it again, load the splash screen and start, in this case if it recognizes the permissions. The error is only shown the first time the app is used after installation.

The code with which I request the permissions is something like this:
------------------------------------------------------------------------------------------------------------
gPermBtConn is Permission = PermissionList("android.permission.BLUETOOTH_CONNECT")
gPermBtScan is Permission = PermissionList("android.permission.BLUETOOTH_SCAN")
IF gPermBtConn.Granted AND gPermBtScan.Granted THEN
RETURN
ELSE
ToastDisplay("Remember to keep Bluetooth permissions enabled!",toastShort,vaMiddle,haCenter)
PermissionRequest(gPermBtConn,procedure(Permission Permission){})
PermissionRequest(gPermBtScan,procedure(Permission Permission Permission){}})
END
-------------------------------------------------------------------------------------------------------------
Therefore I request your help in guiding me if WinDev Mobile has any function that manages the status of the app and that allows to update it at runtime so that the app does not generate the error and recognizes the approved permissions from the first time, after installation on the device.

Thank you very much,
Regards.