Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

116
Visualizações
DeviceOrientationEvent not working on IOS (14.7)

I have this very simple code, based on MDN, to check the device orientation:

const message = document.getElementById("message");
message.textContent = "Start";

document.querySelector("body").addEventListener("click", () => {
    message.textContent = "Clicked";
    window.addEventListener('deviceorientation', function(event) {
        message.textContent = "Triggered";
    });    
});

It is served from a https server. (You can try it here: erikpineiro.se/ori)

It works on Chrome on an Android device (haven't tested other browsers) but it does not work on any of my browsers (Safari, Chrome, Firefox) on IOS (14.7) (tested from an iPhone 8).

Thankful for any tips as to why this might be.

PS: I have read this question but trying to include

DeviceOrientationEvent.requestPermission();

ends up in the error "DeviceOrientationEvent.requestPermission is not a function"

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda