D.Loos
D.Loos

Reputation: 119

Is there a vibration api for UWP?

I'm currently merging an existing WP8.0 and Windows 8.1 app into a single new UWP app and was wondering where the equivalent to Silverlight's VibrateController can be found. I expected to find a similar API that was at least available to the Mobile device family.

Upvotes: 2

Views: 179

Answers (2)

pijemcolu
pijemcolu

Reputation: 2605

You can use Windows.Phone.Devices.Notification namespace in uwp.

using Windows.Phone.Devices.Notification;

public void Vibrate()
{
    var device = VibrationDevice.GetDefault();
    device.Vibrate(TimeSpan.FromMilliseconds(500));
}

Upvotes: 0

user3922344
user3922344

Reputation:

Yes you can, see this 'How to vibrate a Windows Phone device'.

Upvotes: 1

Related Questions