Skip to content
WebViewGold Vibe Coding to App Store
English
Get WebViewGold

ChatGPT & Codex + screenshots

Screenshot protection and saving screenshots in your ChatGPT & Codex app

Paid lessons, private chats, account balances, single-use coupons: some screens should not end up in a group chat. WebViewGold can block screenshots and screen recordings on Android and detect them on iOS, then call a JavaScript function in your ChatGPT & Codex app so you can react. The same toolkit also works the other way round: takescreenshot:// saves a screen to Photos on purpose, for tickets and receipts.

From $109 one-time per platform, or let our team do it all from $698.

  • Approval guarantee – or money back within 14 days
  • No coding needed
  • One-time payment, free updates
  • 24/7 human support
  • Made in Germany since 2014 · ISO 27001

What each platform really offers

CapabilityiOSAndroid
Stop screenshots and screen recordingsNot possible: iOS has no official API that blocks a screenshotPREVENT_SCREEN_CAPTURE = true in Config.java prevents screenshots and screen recordings of the app
Tell the web applet preventScreenCapture = true in Config.swift detects screenshots and screen recordings and calls onScreenCaptureAttempt() (despite the name, the docs describe detection)onScreenCaptureAttempt() is called so you can show your own message
Save the current screen to Photos on purposetakescreenshot://takescreenshot://
ScopeOne switch for the whole app; no per-page setting is documentedOne switch for the whole app; no per-page setting is documented

Prompt for ChatGPT & Codex

Paste this into ChatGPT & Codex to implement the web-app side. Review the result, publish, then test inside the WebViewGold app.

Prompt for ChatGPT or Codex
Prompt for Codex: Implement WebViewGold screen capture handling and open a pull request. Register window.onScreenCaptureAttempt in the app entry file so it is global; it shows a short notice on protected pages and posts the path to a /api/capture-events endpoint that reads the user from the session. Make user-facing text platform-accurate: on iOS say screenshots are detected, on Android say they are disabled; detect the platform with separate custom user-agent tokens (WebViewGold-iOS and WebViewGold-Android). Add saveScreenToPhotos() that navigates to takescreenshot:// inside the app and a Save to Photos button on ticket pages, hidden in browsers. Update the privacy policy page to mention capture-attempt logging. Add tests and record the rules in AGENTS.md.

WebViewGold has allowed us the shortest and most efficient time-to-market ever possible from among all the other app platforms we have ever tried during the past 5 years. I don’t know why I hadn’t discovered you sooner, but I am really, really glad I did. Currently nearing 6000 app downloads on both iOS App Store & Google Play Store without any problem!

Antonio Davila · CodeCanyon

React to a capture attempt in your web app

About 20 minutes plus a new build of both apps.

  1. Switch the setting on

    iOS: let preventScreenCapture = true in Config.swift. Android: PREVENT_SCREEN_CAPTURE = true in Config.java. This is a native change, so it ships with the next app build, not with a web deploy.

  2. Make onScreenCaptureAttempt global

    WebViewGold calls a function with exactly this name. Code bundled by Vite, Next.js or similar tools lives in modules, so a function declared inside a component is not global. Assign it explicitly in code that runs on every page: window.onScreenCaptureAttempt = function () { … }.

  3. Show a calm message

    Explain why ("Lesson slides are protected to respect the creator") instead of logging the user out. On iOS the screenshot has already been taken when the function runs, so the message is a deterrent, not a block.

  4. Log it only if you need to

    Exam, document and finance apps may want an audit trail (user, page, time). If you record it, say so in your privacy policy.

  5. Offer an intended way to save

    Where saving is legitimate (tickets, receipts, certificates), add a Save to Photos button that navigates to takescreenshot://. If you combine it with screenshot blocking on Android, check on a device that the saved image is not blank.

The JavaScript side

Load this once on every page (for example in the app entry file). The optional log endpoint belongs to the server side of your stack: Your own API or serverless functions.

javascript
// Custom user agent containing "WebViewGold" set in Config.swift / Config.java
var IN_APP = navigator.userAgent.indexOf("WebViewGold") !== -1;

// Called by WebViewGold when it detects a screenshot or screen recording (iOS)
// or a capture attempt while PREVENT_SCREEN_CAPTURE is on (Android)
window.onScreenCaptureAttempt = function () {
  showToast("Screenshots are turned off for paid lessons."); // your own UI helper
  fetch("/api/capture-events", {
    method: "POST", keepalive: true,
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ path: location.pathname, at: Date.now() })
  });
};

// Intended saving, for example on a ticket page
function saveTicketToPhotos() {
  if (IN_APP) { window.location.href = "takescreenshot://"; }
  else { window.print(); } // browser fallback
}

Limits to be honest about

  • No protection is absolute: anyone can photograph the screen with a second phone. Use it to discourage casual sharing, not as the only safeguard for confidential data.
  • Store screenshots: with blocking on, Android blocks your own screenshots too. Capture the images for the Play listing before you switch it on, or from a build without it. See store screenshots and listing.
  • Users expect to screenshot tickets, receipts and confirmations. Blocking the whole app because of one sensitive page frustrates them, and that shows up in store reviews.
  • On iOS, plan the experience around detection: a notice, an optional log entry, or a visible watermark with the user's email on sensitive pages.
  • takescreenshot:// saves to the photo library. iOS asks the user for permission the first time, so the Photos purpose string in the Xcode project must say why ("to save your ticket for offline use").

Frequently asked questions

Can I block screenshots on iPhone?

Not completely. iOS has no official API that prevents a screenshot. WebViewGold detects screenshots and screen recordings (preventScreenCapture in Config.swift) and calls onScreenCaptureAttempt in the web app so you can respond. Real blocking is available on Android with PREVENT_SCREEN_CAPTURE in Config.java.

Does screenshot protection cause problems in App Store or Google Play review?

Not by itself. Neither store requires apps to allow screenshots, and detection needs no permission. If protected screens turn black in an Android screen recording, mention it in the review notes so nobody mistakes it for a bug.

Can I protect only some pages?

The WebViewGold docs describe app-wide switches, not a per-page setting. What you control per page is the reaction: onScreenCaptureAttempt can check the current route and only show a notice on sensitive pages.

How do users save a ticket from my ChatGPT & Codex app?

Add a Save to Photos button that navigates to takescreenshot:// inside the app. WebViewGold saves the current WebView content to the Photos gallery, so the ticket is available at the venue even without a connection.

Does onScreenCaptureAttempt work with React, Vue or Svelte code?

Yes, as long as the function is attached to the window object. A function declared inside a component or an ES module is not global, so WebViewGold cannot find it; assign window.onScreenCaptureAttempt in the entry file of your ChatGPT & Codex project.

Three ways to get your app into the stores

Same result, different amount of work on your side. All three come with the approval guarantee and 24/7 human support.

Do it yourself

$109 per platform, one-time

The WebViewGold license: a finished Xcode or Android Studio project. Paste your URL, set name and icon, switch on features, build and submit. Free updates forever.

See plans on the main page

Cloud Builder

$349 per license, one-time add-on

No Mac, no Xcode, no Android Studio: configure in the browser, we build both apps in the cloud and hand them to App Store Connect and the Play Console.

How the Cloud Builder works Try the free demo

Full Service

$698 per platform $798

Send us your URL and icon. Our team configures, builds and delivers your app within 72 hours, white-label, with source projects. Both platforms for $1,158.

Full Service details Powered by WeSetupYourWebViewApp

Winter Sale prices valid until December 31, 2026.

Ready to ship your ChatGPT & Codex app?

App Store & Google Play approval guarantee – or your money back within 14 days

Rather hand it over? Full Service: we configure, build and deliver within 72 hours, from $698 per platform. Questions? Chat with us 24/7.

Refunds are granted under the conditions listed in our FAQ: a non-content rejection by Apple and/or Google, claimed within 14 days after purchase.