Vibration on smartphone
-
Is there a way, to make vibrations on smartphone ?
-
You can use the NativeVibration API:
-
I tried on an Android device, but the app crashes.
java.lang.SecurityException: Requires VIBRATE permission at android.os.Parcel.createException(Parcel.java:1950)
It requires to declare the VIBRATE permission in the AndroidManifest.xml : "<uses-permission android:name="android.permission.VIBRATE" android:maxSdkVersion="18"/>"
I tried to modify the build/platforms/android/src/main/AndroidManifest.xml file, but when I build the app, the modification are erased.
Any idea ?
-
I found the solution.
I had to add "supportVibration()" in the build.gradle.kts :... korge { supportVibration() name = "..." id = "..." }