You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
643 B
24 lines
643 B
import { Platform } from 'react-native';
|
|
|
|
const BlueApp = require('../BlueApp');
|
|
|
|
export default class HandoffSettings {
|
|
static STORAGEKEY = 'HandOff';
|
|
|
|
static async isHandoffUseEnabled() {
|
|
if (Platform.OS !== 'ios') {
|
|
return false;
|
|
}
|
|
try {
|
|
const enabledHandoff = await BlueApp.getItem(HandoffSettings.STORAGEKEY);
|
|
return !!enabledHandoff;
|
|
} catch (_e) {
|
|
await BlueApp.setItem(HandoffSettings.STORAGEKEY, '');
|
|
return false;
|
|
}
|
|
}
|
|
|
|
static async setHandoffUseEnabled(value) {
|
|
await BlueApp.setItem(HandoffSettings.STORAGEKEY, value === true && Platform.OS === 'ios' ? '1' : '');
|
|
}
|
|
}
|
|
|