public async Task <bool> GetAvailabilityAsync() { var access = await HapticsDevice.RequestAccessAsync(); if (access == Windows.Devices.Haptics.VibrationAccessStatus.Allowed) { var device = await HapticsDevice.GetDefaultAsync(); return(device != null); } return(true); }
public async Task VibrateAsync() { var access = await HapticsDevice.RequestAccessAsync(); if (access == Windows.Devices.Haptics.VibrationAccessStatus.Allowed) { var device = await HapticsDevice.GetDefaultAsync(); if (device != null) { device.SimpleHapticsController.SendHapticFeedback(device.SimpleHapticsController.SupportedFeedback[0]); } } }