TinyDB not reseting after uninstallation

I'm using Andres Cotes Camera Viewer Recorder extension. I am using the tinyDB to store when I have obtained permission to use the camera, audio, and storage. The first time I installed the app, I get a request to obtain permission to use the camera, audio and storage then the app works fine. But when I uninstall and reinstall the app, the app will proceed without asking for permission and function like permissions were not obtained. I get the impression that the tinyDB still stores the value for having requested permission after I uninstall the app. So when I reinstall the app, permissions are lost but the app doesn't re-ask for permission. How would I solve this problem so tinyDB resets after I uninstall the app?

The following are the blocks:

You do not need to use the tinydb for the state of permissions, just request permissions on initialise, if they are not already in place you will be asked for them.

Testing for permissions with companion and tinydb then installing with the same device can pick up tinydb items "left behind".

this might happen because of

to disable backup see here

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

I used APK Editor Studio to disable back up for the app. I saved it as an APK using the APK Editor Studio. When I upload it to Google Play I get the error:

"Upload failed

You uploaded an APK that is signed with a different certificate to your previous APKs. You must use the same certificate."

How do I save the apk with the APK Editor and use the same certificate?

Just out of interest, is that the paid version of the extension ?

Yes, you're right

Thank you :slight_smile:

I tried to not store the state of permissions with tinydb. It asks for permissions and records the first time I install and open the app. But when I close and reopen the app, it doesn't ask for permissions and the video doesn't record. The blocks are shown below:

Try like this:

Sorry, I was a bit bit hasty, perhaps more like this:

image

I tried doing that but I'm getting a runtime error "setAudioSource failed". I think it is because I'm not getting permission to use audio.

Missed that, try adding your permission request for audio to screen initialise.

This works for me with what i can do with the free version:

I added the permission request for audio to screen initialize. The app will open and request permission to use the camera but not request permission to use the audio. The app will then have an error about not having permission to use the audio. If I restart the app, I will get a request to use the audio. The app will run and then I get a runtime error that I'm guessing is because it wants permission to use storage.

Having slept on this, and then tried a few things, seems you were on the right line in the first place!

Try these blocks (also test aia attached)

cameratest.aia (21.7 KB)

Note: I have dragged in a File component to give the WRITE_EXTERNAL_STORAGE

I dragged the File component in. But when I run it, I still get the runtime error. But when I request for permission for storage, the runtime error doesn't occur. The app works the first time I run it. But when I try to run it a second time, the app doesn't activate the camera.

1 Like

I'm attaching the aia file.

{EDIT} aia removed because it contains a paid for extension

@Jimmy, please check your private messages