Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to prevent tapping outside the update modal #66

Open
deserthurricane opened this issue May 2, 2022 · 2 comments
Open

Ability to prevent tapping outside the update modal #66

deserthurricane opened this issue May 2, 2022 · 2 comments

Comments

@deserthurricane
Copy link

Hi

I recently started using your lib. Thank you, it's really cool and helps us to deliver new versions to our customers much faster 馃憤

I only have one question on how I can block user interface from tapping outside the installation modal and crashing the app 馃槄
This is how it can be reproduced:

  1. Launch the example app.
  2. Click "Update" in the modal.
  3. Click "Install" in the next modal.
  4. When the installation modal is shown, tap outside of it.
  5. The installation process becomes interrupted, and the app crashes.
Prevent.tap.outside.and.app.crash.-.720p.mov

I tried to investigate the source code of your lib - ACTION_INSTALL_PACKAGE intent is called for updating the application. I googled if there are any special flags like "setCancellable(false)" that we could pass to this intent, but didn't find any.

Then I tried to make a fix at the "react-native" side and added a View with absolute position and pointerEvents="none" prop on the whole screen. But unfortunately this didn't work: if I tap on that View, the installation modal closes immediately.

How do you think, are there any ways to prevent installation modal from being closed and the app - crashed? Or is it a standard Android behavior which we cannot change?

@mikehardy
Copy link
Owner

Hi there! I'm glad you find the module useful, I do still use it myself. Unfortunately I have not probed the use case you indicate, I only distribute updates like this to my developers and I assume they will either "behave" (if it crashes when you do that....don't do that) or that it's fine if it crashes in a cornercase.

So this isn't a use case I personally care to spend time investigating, just for transparency.

However! I can think of one other system that does updates like this and may serve for inspiration - the F-Droid 3rd party app repository. I suppose APKPure too but I know F-Droid is open source, maybe that helps?

If you do discover something and it's worth a PR I'd be happy to collaborate to merge and release it of course - the project's not dead and I am interested in it working, and working well - I just don't need this specific feature so you'd have to develop it.

Hope this helps?

@deserthurricane
Copy link
Author

@mikehardy thank you for your answer! I will investigate the alternatives you proposed. Also, if I have an idea how to add the expected behavior to the current library, I will send a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants