Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG

## v5.0.0 - 2026-03-16

- **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

`'granted' | 'denied'` (removed `'settings_change_required'`)

## v4.2.0 - 2026-03-13

- `bottomSheet`: Add basic Tag to Sheet of type LIST / SINGLE_SELECTION
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1890,13 +1890,13 @@ Request background location permission from the user.

```ts
requestPermissionBackgroundLocation: () => Promise<{
status: 'granted' | 'denied' | 'settings_change_required';
status: 'granted' | 'denied';
}>;
```

#### Notes

- Android: show a custom alert and navigate to OS settings on accept.
- Android: this method navigates to OS settings.
- iOS: upgrade to Always happens via OS escalation after background usage.

#### Error cases
Expand Down Expand Up @@ -1953,13 +1953,13 @@ Request permission to disable battery optimization (Android only).

```ts
requestPermissionBatteryOptimization: () => Promise<{
status: 'denied' | 'settings_change_required';
status: 'granted' | 'denied';
}>;
```

#### Notes

- Android: show a custom alert and navigate to OS settings on accept.
- Android: this method navigates to OS settings.

#### Error cases

Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/family-locator-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,12 @@ test('requestPermissionBackgroundLocation', async () => {
getResponse: (msg) => ({
type: 'REQUEST_PERMISSION_BACKGROUND_LOCATION',
id: msg.id,
payload: {status: 'settings_change_required'},
payload: {status: 'granted'},
}),
});

const res = await requestPermissionBackgroundLocation();
expect(res).toEqual({status: 'settings_change_required'});
expect(res).toEqual({status: 'granted'});
});

test('requestPermissionMicrophone', async () => {
Expand Down Expand Up @@ -320,10 +320,10 @@ test('requestPermissionBatteryOptimization', async () => {
getResponse: (msg) => ({
type: 'REQUEST_PERMISSION_BATTERY_OPTIMIZATION',
id: msg.id,
payload: {status: 'settings_change_required'},
payload: {status: 'denied'},
}),
});

const res = await requestPermissionBatteryOptimization();
expect(res).toEqual({status: 'settings_change_required'});
expect(res).toEqual({status: 'denied'});
});
4 changes: 2 additions & 2 deletions src/family-locator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const requestPermissionLocation = (): Promise<{
}> => postMessageToNativeApp({type: 'REQUEST_PERMISSION_LOCATION'});

export const requestPermissionBackgroundLocation = (): Promise<{
status: PermissionStatus | 'settings_change_required';
status: PermissionStatus;
}> => postMessageToNativeApp({type: 'REQUEST_PERMISSION_BACKGROUND_LOCATION'});

export const requestPermissionMicrophone = (): Promise<{
Expand All @@ -145,5 +145,5 @@ export const requestPermissionCriticalAlerts = (): Promise<{
}> => postMessageToNativeApp({type: 'REQUEST_PERMISSION_CRITICAL_ALERTS'});

export const requestPermissionBatteryOptimization = (): Promise<{
status: 'denied' | 'settings_change_required';
status: PermissionStatus;
}> => postMessageToNativeApp({type: 'REQUEST_PERMISSION_BATTERY_OPTIMIZATION'});
4 changes: 2 additions & 2 deletions src/post-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export type ResponsesFromNativeApp = {
id: string;
type: 'REQUEST_PERMISSION_BACKGROUND_LOCATION';
payload: {
status: 'granted' | 'denied' | 'settings_change_required';
status: 'granted' | 'denied';
};
};
REQUEST_PERMISSION_MICROPHONE: {
Expand Down Expand Up @@ -208,7 +208,7 @@ export type ResponsesFromNativeApp = {
id: string;
type: 'REQUEST_PERMISSION_BATTERY_OPTIMIZATION';
payload: {
status: 'denied' | 'settings_change_required';
status: 'granted' | 'denied';
};
};
INTERNAL_NAVIGATION: {
Expand Down
Loading