[PR #2037] [MERGED] [SG-381] Passwordless - Add setting to Mobile #83148

Closed
opened 2026-05-22 16:38:57 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2037
Author: @andrebispo5
Created: 8/15/2022
Status: ✅ Merged
Merged: 8/15/2022
Merged by: @andrebispo5

Base: feature/feature-passwordless-login ← Head: feature/passwordless-login-setting


📝 Commits (5)

  • 7aa6047 [SG-381] Added settings option to approve passwordless login request. If user has notifications disabled, prompt to go to settings and enable them.
  • dda518e [SG-381] Update settings pop up texts.
  • 08f8b5c [SG-381] Added new method to get notifications state on device settings. Added userId to property saved on device to differentiate value between users.
  • 35f0fc0 [SG-381] Added text for the popup on selection.
  • 49db559 [SG-381] PR Fixes

📊 Changes

13 files changed (+140 additions, -1 deletions)

View changed files

📝 src/Android/Services/AndroidPushNotificationService.cs (+5 -0)
📝 src/Android/Services/DeviceActionService.cs (+9 -0)
📝 src/App/Abstractions/IDeviceActionService.cs (+1 -0)
📝 src/App/Abstractions/IPushNotificationService.cs (+1 -0)
📝 src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs (+42 -1)
📝 src/App/Resources/AppResources.Designer.cs (+30 -0)
📝 src/App/Resources/AppResources.resx (+15 -0)
📝 src/App/Services/NoopPushNotificationService.cs (+5 -0)
📝 src/Core/Abstractions/IStateService.cs (+2 -0)
📝 src/Core/Constants.cs (+1 -0)
📝 src/Core/Services/StateService.cs (+17 -0)
📝 src/iOS.Core/Services/DeviceActionService.cs (+6 -0)
📝 src/iOS/Services/iOSPushNotificationService.cs (+6 -0)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Add a setting to the Bitwarden mobile app under the “Security” section: “Approve login requests”
Default state is Disabled.
When user Enables the option, check to see if the Bitwarden app has notification permissions. If not, request them. Even if the user does not enable notifications, the Approve login requests feature is enabled.

Code changes

  • src/iOS/Services/iOSPushNotificationService.cs: Added new method because iOS has different approach on notifications status. I needed a way to tell if the user had blocked the "alert notifications" in order to redirect to the settings.

Screenshots

New entry in the security section of settings tab:
image
Dialog to provide additional information and enable/disable the feature:
image
If the user doesn't have notification "Alert" enable, show this dialog to open settings directly:
image

Before you submit

  • I have checked for formatting errors (dotnet tool run dotnet-format --check) (required)
  • I have added unit tests where it makes sense to do so (encouraged but not required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/2037 **Author:** [@andrebispo5](https://github.com/andrebispo5) **Created:** 8/15/2022 **Status:** ✅ Merged **Merged:** 8/15/2022 **Merged by:** [@andrebispo5](https://github.com/andrebispo5) **Base:** `feature/feature-passwordless-login` ← **Head:** `feature/passwordless-login-setting` --- ### 📝 Commits (5) - [`7aa6047`](https://github.com/bitwarden/android/commit/7aa6047ebacbd0f2905754d69120a86716839ed8) [SG-381] Added settings option to approve passwordless login request. If user has notifications disabled, prompt to go to settings and enable them. - [`dda518e`](https://github.com/bitwarden/android/commit/dda518e0abb52a989fb6595c743f755f1a5f5271) [SG-381] Update settings pop up texts. - [`08f8b5c`](https://github.com/bitwarden/android/commit/08f8b5c0d7155d60efc6eabf3b58f58112b28267) [SG-381] Added new method to get notifications state on device settings. Added userId to property saved on device to differentiate value between users. - [`35f0fc0`](https://github.com/bitwarden/android/commit/35f0fc050a07bc137f3fa5a4088413c42bf1ea34) [SG-381] Added text for the popup on selection. - [`49db559`](https://github.com/bitwarden/android/commit/49db5590caf20e9f5050c6a85d445e84bf75c7bd) [SG-381] PR Fixes ### 📊 Changes **13 files changed** (+140 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/Services/AndroidPushNotificationService.cs` (+5 -0) 📝 `src/Android/Services/DeviceActionService.cs` (+9 -0) 📝 `src/App/Abstractions/IDeviceActionService.cs` (+1 -0) 📝 `src/App/Abstractions/IPushNotificationService.cs` (+1 -0) 📝 `src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs` (+42 -1) 📝 `src/App/Resources/AppResources.Designer.cs` (+30 -0) 📝 `src/App/Resources/AppResources.resx` (+15 -0) 📝 `src/App/Services/NoopPushNotificationService.cs` (+5 -0) 📝 `src/Core/Abstractions/IStateService.cs` (+2 -0) 📝 `src/Core/Constants.cs` (+1 -0) 📝 `src/Core/Services/StateService.cs` (+17 -0) 📝 `src/iOS.Core/Services/DeviceActionService.cs` (+6 -0) 📝 `src/iOS/Services/iOSPushNotificationService.cs` (+6 -0) </details> ### 📄 Description ## Type of change - [ ] Bug fix - [X] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> Add a setting to the Bitwarden mobile app under the “Security” section: “Approve login requests” Default state is Disabled. When user Enables the option, check to see if the Bitwarden app has notification permissions. If not, request them. Even if the user does not enable notifications, the Approve login requests feature is enabled. ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **src/iOS/Services/iOSPushNotificationService.cs:** Added new method because iOS has different approach on notifications status. I needed a way to tell if the user had blocked the "alert notifications" in order to redirect to the settings. ## Screenshots <!--Required for any UI changes. Delete if not applicable--> New entry in the security section of settings tab: <img width="358" alt="image" src="https://user-images.githubusercontent.com/4648522/184619462-c5298064-0467-4191-a7d7-3b9f2eacfb4b.png"> Dialog to provide additional information and enable/disable the feature: <img width="360" alt="image" src="https://user-images.githubusercontent.com/4648522/184653480-9dadbbaa-4107-4a71-933c-4a95d26e44eb.png"> If the user doesn't have notification "Alert" enable, show this dialog to open settings directly: <img width="359" alt="image" src="https://user-images.githubusercontent.com/4648522/184619543-1c46229e-f294-4d1c-9a3a-418d5a87e1bc.png"> ## Before you submit - [x] I have checked for formatting errors (`dotnet tool run dotnet-format --check`) (required) - [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required) - [ ] This change requires a **documentation update** (notify the documentation team) - [ ] This change has particular **deployment requirements** (notify the DevOps team) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-22 16:38:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#83148