Skip to content

Commit

Permalink
Bump to 3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek committed Mar 9, 2022
1 parent e94c260 commit 9ce24d0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,9 +754,9 @@ type NotificationSettings = {
carPlay?: boolean;
criticalAlert?: boolean;
provisional?: boolean;
providesAppSettings?: boolean;
lockScreen?: boolean;
notificationCenter?: boolean;
providesAppSettings?: boolean;
};

function checkNotifications(): Promise<{
Expand Down Expand Up @@ -802,9 +802,9 @@ type NotificationSettings = {
carPlay?: boolean;
criticalAlert?: boolean;
provisional?: boolean;
providesAppSettings?: boolean;
lockScreen?: boolean;
notificationCenter?: boolean;
providesAppSettings?: boolean;
};

function requestNotifications(options: NotificationOption[]): Promise<{
Expand Down
2 changes: 1 addition & 1 deletion example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ export const App = () => {
{`carPlay: ${notifications.settings.carPlay}\n`}
{`criticalAlert: ${notifications.settings.criticalAlert}\n`}
{`provisional: ${notifications.settings.provisional}\n`}
{`providesAppSettings: ${notifications.settings.providesAppSettings}\n`}
{`lockScreen: ${notifications.settings.lockScreen}\n`}
{`notificationCenter: ${notifications.settings.notificationCenter}\n`}
{`providesAppSettings: ${notifications.settings.providesAppSettings}\n`}
</Text>
)}
</>
Expand Down
21 changes: 12 additions & 9 deletions mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ export const request = jest.fn(async (permission) => RESULTS.GRANTED);
export const checkLocationAccuracy = jest.fn(async () => 'full');
export const requestLocationAccuracy = jest.fn(async (options) => 'full');

const notificationOptions = ['alert', 'badge', 'sound', 'carPlay', 'criticalAlert', 'provisional'];
const notificationOptions = [
'alert',
'badge',
'sound',
'carPlay',
'criticalAlert',
'provisional',
'providesAppSettings',
];

const notificationSettings = {
alert: true,
Expand All @@ -28,6 +36,7 @@ const notificationSettings = {
carPlay: true,
criticalAlert: true,
provisional: true,
providesAppSettings: true,
lockScreen: true,
notificationCenter: true,
};
Expand All @@ -48,17 +57,11 @@ export const requestNotifications = jest.fn(async (options) => ({
}));

export const checkMultiple = jest.fn(async (permissions) =>
permissions.reduce((acc, permission) => ({
...acc,
[permission]: RESULTS.GRANTED,
}), {}),
permissions.reduce((acc, permission) => ({...acc, [permission]: RESULTS.GRANTED}), {}),
);

export const requestMultiple = jest.fn(async (permissions) =>
permissions.reduce((acc, permission) => ({
...acc,
[permission]: RESULTS.GRANTED,
}), {}),
permissions.reduce((acc, permission) => ({...acc, [permission]: RESULTS.GRANTED}), {}),
);

export default {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-permissions",
"version": "3.3.0",
"version": "3.3.1",
"license": "MIT",
"description": "An unified permissions API for React Native on iOS, Android and Windows",
"author": "Mathieu Acthernoene <zoontek@gmail.com>",
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export type NotificationSettings = {
carPlay?: boolean;
criticalAlert?: boolean;
provisional?: boolean;
providesAppSettings?: boolean;
lockScreen?: boolean;
notificationCenter?: boolean;
providesAppSettings?: boolean;
};

export type NotificationsResponse = {
Expand Down

0 comments on commit 9ce24d0

Please sign in to comment.