iOS Question Vibrate Phone (Short Vibrate)

Discussion in 'iOS Questions' started by aaronk, Jul 5, 2019.

  1. aaronk

    aaronk Well-Known Member Licensed User


    I am trying to make the phone vibrate when a button is pressed.

    I have found that I can use code like:

    Dim vib As Phone
    However, when I use this code it seems that it vibrates the phone for approx 1 second.

    Is there a way in making it vibrate the phone for 100-200ms (like a short keypress vibrate) rather than a long vibration like it's doing now ?
  2. Erel

    Erel Administrator Staff Member Licensed User

    Private FeedbackGenerator As NativeObject 'globals
    2. Initialize:
    If FeedbackGenerator.IsInitialized Then
       FeedbackGenerator = FeedbackGenerator.RunMethod(
    "alloc"Null).RunMethod("initWithStyle:"Array(0)) 'light
    End If
    3. Vibrate:
    If FeedbackGenerator.IsInitialized Then
    End If
  3. aaronk

    aaronk Well-Known Member Licensed User

    Thanks heaps, works a treat.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice