Change requestPermissionBackgroundLocation and requestPermissionBatteryOptimization responses#257
Change requestPermissionBackgroundLocation and requestPermissionBatteryOptimization responses#257ieduardogf merged 3 commits intomasterfrom
Conversation
…ryOptimization responses
There was a problem hiding this comment.
Pull request overview
This PR updates the webview-bridge permission request API for Family Locator to align with the Android implementation by removing the settings_change_required response status from background location and battery optimization permission requests.
Changes:
- Update TypeScript response types to return only
status: 'granted' | 'denied'forREQUEST_PERMISSION_BACKGROUND_LOCATIONandREQUEST_PERMISSION_BATTERY_OPTIMIZATION. - Update Family Locator SDK method typings and corresponding Jest tests to match the new response contract.
- Update README documentation and add a changelog entry describing the breaking change.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/post-message.ts |
Narrows native response payload status unions for the two permission response message types. |
src/family-locator.ts |
Updates the public SDK method return types to remove settings_change_required and standardize on PermissionStatus. |
src/__tests__/family-locator-test.ts |
Adjusts tests to expect only granted/denied payloads for the affected methods. |
README.md |
Updates documented method signatures and notes to reflect the new response contract. |
CHANGELOG.md |
Adds a new release entry documenting the breaking API change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
CHANGELOG.md
Outdated
| ## v4.2.0 - 2026-03-12 | ||
|
|
||
| - **Breaking change**: `requestPermissionBackgroundLocation` now returns | ||
| `'granted' | 'denied'` (removed `'settings_change_required'`) | ||
| - **Breaking change**: `requestPermissionBatteryOptimization` now returns | ||
| `'granted' | 'denied'` (removed `'settings_change_required'`) |
There was a problem hiding this comment.
The changelog labels this release as v4.2.0 while also marking the change as Breaking. Given previous breaking changes were released with a major bump (e.g., v4.0.0), this should likely be a v5.0.0 entry if the project is following semver, to avoid misleading consumers about compatibility.
There was a problem hiding this comment.
I'm not sure what the version politics of the bridge are. Waiting for web team review.
There was a problem hiding this comment.
Yes, following semver that should be 5.0.0
CHANGELOG.md
Outdated
| @@ -1,5 +1,12 @@ | |||
| # CHANGELOG | |||
|
|
|||
| ## v4.2.0 - 2026-03-12 | |||
There was a problem hiding this comment.
CHANGELOG.md introduces a v4.2.0 section, but the repo's package.json version is still 4.1.0. This mismatch can cause confusion when publishing/releasing; consider updating the package version (or adjusting the changelog header) so they stay in sync.
| ## v4.2.0 - 2026-03-12 | |
| ## Unreleased |
There was a problem hiding this comment.
I'm not sure what the version politics of the bridge are. Waiting for web team review.
Marcosld
left a comment
There was a problem hiding this comment.
We are working on creating a github action to publish new versions of this package. Let us know by the time you merge this branch to see if it is already available or we have to manually publish it.
|
|
||
| - **Breaking change**: `requestPermissionBackgroundLocation` now returns | ||
| `'granted' | 'denied'` (removed `'settings_change_required'`) | ||
| - **Breaking change**: `requestPermissionBatteryOptimization` now returns |
There was a problem hiding this comment.
No, they are two different methods
# Conflicts: # CHANGELOG.md
@Marcosld, I don't have permissions to merge the PR, so I would appreciate it if you could merge it. We would like to release the new version as soon as possible because Vivo will start the integration with these methods soon. |
Unfortunately I checked and I don't have permissions to publish the package either :( We will have to wait for @atabel coming back from holidays on friday :( |
|
I merged the branch |
Closes #255
This pull request introduces breaking changes to the permission request API for background location and battery optimization. The main update is the removal of the
'settings_change_required'status from bothrequestPermissionBackgroundLocationandrequestPermissionBatteryOptimization. Now, these methods only return'granted'or'denied'. Documentation, type definitions, and tests have been updated accordingly.