代码拉取完成,页面将自动刷新
const {
PERMISSIONS: {ANDROID},
} = require('./dist/commonjs/permissions.android');
const {
PERMISSIONS: {IOS},
} = require('./dist/commonjs/permissions.ios');
const {
PERMISSIONS: {WINDOWS},
} = require('./dist/commonjs/permissions.windows');
const {RESULTS} = require('./dist/commonjs/results');
const PERMISSIONS = {ANDROID, IOS, WINDOWS};
export {PERMISSIONS, RESULTS};
export const openLimitedPhotoLibraryPicker = jest.fn(async () => {});
export const openSettings = jest.fn(async () => {});
export const check = jest.fn(async (permission) => RESULTS.GRANTED);
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',
'providesAppSettings',
];
const notificationSettings = {
alert: true,
badge: true,
sound: true,
carPlay: true,
criticalAlert: true,
provisional: true,
providesAppSettings: true,
lockScreen: true,
notificationCenter: true,
};
export const checkNotifications = jest.fn(async () => ({
status: RESULTS.GRANTED,
settings: notificationSettings,
}));
export const requestNotifications = jest.fn(async (options) => ({
status: RESULTS.GRANTED,
settings: options
.filter((option) => notificationOptions.includes(option))
.reduce((acc, option) => ({...acc, [option]: true}), {
lockScreen: true,
notificationCenter: true,
}),
}));
export const checkMultiple = jest.fn(async (permissions) =>
permissions.reduce((acc, permission) => ({...acc, [permission]: RESULTS.GRANTED}), {}),
);
export const requestMultiple = jest.fn(async (permissions) =>
permissions.reduce((acc, permission) => ({...acc, [permission]: RESULTS.GRANTED}), {}),
);
export default {
PERMISSIONS,
RESULTS,
check,
checkLocationAccuracy,
checkMultiple,
checkNotifications,
openLimitedPhotoLibraryPicker,
openSettings,
request,
requestLocationAccuracy,
requestMultiple,
requestNotifications,
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。