Skip to content
Closed
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

## v4.2.0 - TBD

- `requestPermissionBackgroundLocation`: response simplified to
`status: "granted" | "denied"` (removed `settings_change_required`)
- `requestPermissionBatteryOptimization`: response simplified to
`status: "granted" | "denied"` (removed `settings_change_required`)

## v4.1.0 - 2026-02-27

- Family Locator SDK request permission methods: `requestPermissionLocation`,
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1894,7 +1894,7 @@ Request background location permission from the user.

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

Expand Down Expand Up @@ -1957,7 +1957,7 @@ Request permission to disable battery optimization (Android only).

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

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