Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

85
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!