iOS Question Tactile response

TheRealMatze

Active Member
Licensed User
Hello,
is it possible to give a tactile response manually (for example onclick)? In Android i use phonevibrate with 5ms duration. This is far away from excellent, but better than nothing. On B4i is phonevibrate not available, is there anything else i can use?

Thanks!

Regards
Matthias
 

TheRealMatze

Active Member
Licensed User
Ok, tried, but there is no vibration...


B4X:
Private Sub btnstore_Click
    #if b4a
    Dim phv As PhoneVibrate
    phv.vibrate(5)
    #end if
    #if b4i
    Log("Vibrate")
    XUIViewsUtils.PerformHapticFeedback(btnstore)
    Log("//Vibrate")
    #end if
    ...
end sub

btnstore is a label, is it not working this way? What view is expected as parameter?

Regards
Matthias
 
Upvote 0

roumei

Active Member
Licensed User
Haptic feedback is only available since the iPhone 6S. If you've got a newer device, check your phone's settings under 'Sounds & Haptics' and activate 'System Haptics'.
 
Upvote 0

TheRealMatze

Active Member
Licensed User
Cross platform code:
B4X:
Private Sub btnstore_Click
    XUIViewsUtils.PerformHapticFeedback(btnstore)
end sub
So you would use only this and no phonevibrate also for android? On older device it looks like it will not work. On my oneplus nord .PerformHapticFeedback(btnstore) feels exactly the same as .vibrate(5). On a galaxy s2 plus (7 years old, the oldest of my testdevice) only .vibrate works (but i get no error on PerformHapticFeedback). The app is not always running on the primary device of the user, so it´s more likely that older devices are used. Can i check if PerformHapticFeedback works by code?
 
Upvote 0
Top