Skip to content

Change requestPermissionBackgroundLocation and requestPermissionBatteryOptimization responses#257

Merged
ieduardogf merged 3 commits intomasterfrom
issue-255
Mar 16, 2026
Merged

Change requestPermissionBackgroundLocation and requestPermissionBatteryOptimization responses#257
ieduardogf merged 3 commits intomasterfrom
issue-255

Conversation

@jeslat
Copy link
Contributor

@jeslat jeslat commented Mar 12, 2026

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 both requestPermissionBackgroundLocation and requestPermissionBatteryOptimization. Now, these methods only return 'granted' or 'denied'. Documentation, type definitions, and tests have been updated accordingly.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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' for REQUEST_PERMISSION_BACKGROUND_LOCATION and REQUEST_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
Comment on lines +3 to +8
## 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'`)
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the version politics of the bridge are. Waiting for web team review.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, following semver that should be 5.0.0

CHANGELOG.md Outdated
@@ -1,5 +1,12 @@
# CHANGELOG

## v4.2.0 - 2026-03-12
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
## v4.2.0 - 2026-03-12
## Unreleased

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the version politics of the bridge are. Waiting for web team review.

Copy link
Collaborator

@ieduardogf ieduardogf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

Copy link
Contributor

@Marcosld Marcosld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it duplicated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, they are two different methods

# Conflicts:
#	CHANGELOG.md
@jeslat
Copy link
Contributor Author

jeslat commented Mar 16, 2026

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.

@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.

@Marcosld
Copy link
Contributor

Marcosld commented Mar 16, 2026

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.

@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 :(

@ieduardogf ieduardogf merged commit d0b3a87 into master Mar 16, 2026
2 checks passed
@ieduardogf ieduardogf deleted the issue-255 branch March 16, 2026 10:50
@ieduardogf
Copy link
Collaborator

I merged the branch

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.

[Update] Change requestPermissionBackgroundLocation and requestPermissionBatteryOptimization responses

5 participants