Home > Technical & Creative Skills > Programming, Servers & Scripts

mobile LP audio + vibrate not working on iPhone? (4)


02-12-2017 12:53 PM #1 aloeveraa1491 (Member)
mobile LP audio + vibrate not working on iPhone?

I've noticed that for mobile LP, the audio and vibrate works on ANDROID (using Chrome browser), but does not work on iPhone (using Safari)

Is that normal?

for audio script, i'm using as erikgyepes suggested in another thread >>>

<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.0.0/howler.core.min.js"></script>
<script>
var sound = new Howl({
src: ['alert.mp3'],
autoplay: true,
volume: 1
});
</script>
for vibrate script, I'm using this:

(function() {
navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate;
navigator.vibrate([1000, 500]);
})();
Anyone can shed some light on this?


02-12-2017 01:14 PM #2 platinum (Veteran Member)

Neither one of the codes will work on Safari Browser from IOS.

Such limitations apply as well even on some versions of android.


02-12-2017 01:37 PM #3 mrbraun (Moderator)

Yes, right.
It doesn't work on iOS and some Android versions. In this case I try to use another scripts for these OSs like ExitPop, BackFix etc.


02-12-2017 02:36 PM #4 erikgyepes (Moderator)

Unfortunately lot of the scripts we are using on our LPs doesn't work on iOS.

I'm not sure if back button that @mrbraun is suggesting works as well, but I know that at least native javascript alert() works.


Home > Technical & Creative Skills > Programming, Servers & Scripts