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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: The WiFi hotspot no longer starts automatically after granting notification permission in Android 13 and above. #3729

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

MohitMaliFtechiz
Copy link
Collaborator

Fixes #3728

  • We implemented the registerForActivityResult method to handle notification permission, ensuring the hotspot starts seamlessly upon permission grant.
Before Fix After Fix
HotspotNotStarting.mp4
HotspotNotAutomaticallyStartingFix.mp4
  • Improved the permission-asking scenario. Before it ask once for notification permission and at the second time it shows the custom dialog that shows why we need this permission. But we can ask permission twice in our application so we have improved the asking of permission. If the user denies this permission then we show the custom dialog with the message why we need this permission.
Before Fix After Fix
PermissionBefore.mp4
PermissionAfter.mp4

Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 16.66667% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 51.82%. Comparing base (f483ff1) to head (b5c99ca).

Files Patch % Lines
...iwix/kiwixmobile/core/webserver/ZimHostFragment.kt 16.66% 10 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3729      +/-   ##
============================================
- Coverage     52.47%   51.82%   -0.66%     
+ Complexity     1259     1225      -34     
============================================
  Files           291      291              
  Lines         10957    10960       +3     
  Branches       1464     1465       +1     
============================================
- Hits           5750     5680      -70     
- Misses         4240     4316      +76     
+ Partials        967      964       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

… notification permission in Android 13 and above.

* We implemented the `registerForActivityResult` method to handle notification permission, ensuring the hotspot starts seamlessly upon permission grant.
* Improved the permission-asking scenario. Before it ask once for notification permission and at the second time it shows the custom dialog that shows why we need this permission. But we can ask permission twice in our application so we have improved the asking of permission. If the user denies this permission then we show the custom dialog with message why we need this permission.
@kelson42
Copy link
Collaborator

kelson42 commented Mar 5, 2024

@MohitMaliDeveloper I don't understand how it works smoothly now: last screencase show twice the notification popup (the very same one) and then the settings... how is that better?

@MohitMaliFtechiz
Copy link
Collaborator Author

@kelson42 It shows the notification permission when the user clicks on the "START SERVER" button. and if the user denies the permission intentionally or by mistake, and again tries to start the hotspot via clicking on the "START SERVER" button, then the application again asks for notification permission(if not permanently denied), so the user has an extra chance to grant the permission without going into application settings, and if he again denies the permission then immediately shows the custom dialog with the message why we need this permission (as we were showing previously). So in this scenario user has an extra chance to rethink/grant the permission.

@kelson42 kelson42 merged commit a1eae97 into main Mar 5, 2024
8 of 10 checks passed
@kelson42 kelson42 deleted the Fix#3728 branch March 5, 2024 12:46
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

Successfully merging this pull request may close these issues.

Wifi hotspot does not automatically start after giving the notification permission in Android 13 and above.
3 participants