Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

86
Vistas
webkit.messageHandlers not working on iPad

Summarize the problem

I registered my iOS app on the App Store, but it was rejected. Basically it works fine on iPhone. But I've heard that there is a feature that doesn't work properly on the iPad. The app partially has a webview. In my tests, it didn't work on iPads (15.2, 15.1). It may not work on older versions as well. Calling webkit.messageHandlers from webview not working

Describe what you’ve tried

At the beginning of the project we developed using modern JavaScript syntax. However, the import/export syntax in iOS version 14.2 caused problems and fixed code compatibility issues with webpack. I haven't tried the solution because I can't figure out why iPhones and iPads behave differently.

My Code

import { checkAndroid, checkIos } from "../../js/utils/index.js";

const step1El = document.querySelector("#step1");
const step2El = document.querySelector("#step2");
const btnEl = document.querySelector("button");

btnEl.onclick = function () {
  if (!step1El.checked)
    return alert("블록체인 간편인증 서비스 이용약관에 동의해주세요");
  if (!step2El.checked)
    return alert("개인정보 수집 및 이용 동의서에 동의해주세요");

  if (checkAndroid()) window.Android.agree();
  if (checkIos()) webkit.messageHandlers.agree.postMessage(""); // not working on iPad
};

document.querySelector(".tos_btn").onclick = () => {
  if (checkAndroid()) window.Android.goTermsConditions(true);
  if (checkIos()) webkit.messageHandlers.goTermsConditions.postMessage(true); // not working on iPad
};
document.querySelector(".policy_btn").onclick = () => {
  if (checkAndroid()) window.Android.goCollectionAgreement();
  if (checkIos()) webkit.messageHandlers.goCollectionAgreement.postMessage(""); // not working on iPad
};
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I solved the problem.

The problem was my mistake.

The problem was in the checkIos function

before

export function checkIos() {
  const userAgent = window.navigator.userAgent.toLowerCase();
  if (userAgent.indexOf("iphone") > -1)
    return true;
  return false;
}

after

export function checkIos() {
  const userAgent = window.navigator.userAgent.toLowerCase();
  if (userAgent.indexOf("iphone") > -1 || userAgent.indexOf("ipad") > -1)
    return true;
  return false;
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda