Referral and coupon codes
One tap copies the code, a short "Copied" confirmation appears, and the user pastes it into WhatsApp or Messages. Faster than selecting text with a long press.
Replit + clipboard
Copy buttons that silently fail and paste fields that never fill are classic WebView annoyances. In a WebViewGold app, your Replit app reads the device clipboard on demand with getclipboard:// (the content lands in the clipboarddata variable), and copying uses the standard web Clipboard API with a fallback. Here is the pattern, plus the privacy rules both platforms enforce.
From $109 one-time per platform, or let our team do it all from $698.
One tap copies the code, a short "Copied" confirmation appears, and the user pastes it into WhatsApp or Messages. Faster than selecting text with a long press.
A Paste button next to an invite code, tracking number or link field reads the clipboard with getclipboard:// and fills the input. Ideal for "save a link" and "join a team" flows.
Wallet addresses, booking references, API keys, Wi-Fi passwords: values nobody should retype. Copy them with a button and show the value next to it.
Chat, writing and prompt tools need a Copy button on every answer; users paste the result into email, notes or social apps.
Paste this into Replit to implement the web-app side. Review the result, publish, then test inside the WebViewGold app.
Add copy and paste support for the WebViewGold native app wrapper. 1) Backend: add GET /api/me/referral returning the logged-in user's referral code and an invite URL built from the APP_URL secret. 2) Frontend: create src/lib/clipboard.ts with copyText(text) (navigator.clipboard.writeText inside the click handler, hidden textarea plus document.execCommand("copy") as fallback) and readNativeClipboard() which, only when navigator.userAgent contains WebViewGold, sets window.clipboarddata = undefined, navigates to getclipboard:// and polls window.clipboarddata every 100 ms for up to 3 seconds. 3) Load the referral data when the Invite page mounts and show Copy buttons for the code and the invite URL with a short "Copied" message. 4) Add a Paste button to the tracking number field that uses readNativeClipboard() and trims the value. 5) Hide Paste in normal browsers and never read the clipboard on load.
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!
About 30 minutes.
Call navigator.clipboard.writeText() directly in the click handler, before any slow request: WebViews refuse clipboard writes that happen outside a user gesture. Keep a fallback with a hidden textarea and document.execCommand("copy").
Show a short toast. Android 13 and later display their own copy confirmation, so keep yours small. Inside the app you can add a lighthaptic:// tap, one bridge call at a time.
When the user taps Paste, clear window.clipboarddata, navigate to getclipboard:// (inside the app only, detected by your custom user agent), then poll for the variable for a few seconds and fill the field.
Trim the value and check that it looks right (an 8-character invite code, a URL on an allowed domain) before you use it. Never auto-submit clipboard content.
Never read the clipboard on page load, on a timer or in the background. iOS can ask users to allow pasting and Android shows a notice when an app reads the clipboard, so an unrequested read looks like snooping.
Copy works in the browser and in the app; Paste uses the native bridge inside the app. Wire them to the buttons of your Replit app:
var IN_APP = navigator.userAgent.indexOf("WebViewGold") !== -1; // your custom user agent token
// Copy: call directly from the click handler
function copyText(text) {
if (navigator.clipboard && window.isSecureContext) {
return navigator.clipboard.writeText(text).catch(function () { legacyCopy(text); });
}
legacyCopy(text);
return Promise.resolve();
}
function legacyCopy(text) {
var ta = document.createElement("textarea");
ta.value = text;
ta.setAttribute("readonly", "");
ta.style.position = "fixed";
ta.style.opacity = "0";
document.body.appendChild(ta);
ta.select();
document.execCommand("copy");
document.body.removeChild(ta);
}
// Paste: read the device clipboard (app only, on a tap)
function pasteInto(input) {
if (!IN_APP) { input.focus(); return; } // browser: long-press and paste
window.clipboarddata = undefined;
window.location.href = "getclipboard://";
var started = Date.now();
(function check() {
if (typeof window.clipboarddata !== "undefined") {
input.value = String(window.clipboarddata || "").trim();
} else if (Date.now() - started < 3000) {
setTimeout(check, 100);
}
})();
}navigator.clipboard.writeText only works on https pages and during a user gesture. A call after an awaited request or from a timer is refused, and some WebViews block the API entirely. Copy directly in the tap handler and keep the textarea fallback.
It should not, and the systems make it visible: iOS can ask the user to allow pasting, and Android shows a notice when an app reads the clipboard. Read it only when the user taps a Paste button.
The current clipboard contents, injected into the global JavaScript variable clipboarddata. The value arrives asynchronously, so wait for the variable after the call instead of reading it on the next line.
Yes. Users can always long-press a text field and choose Paste, which needs no code. getclipboard:// adds the one-tap Paste button that fills a field for them.
Same result, different amount of work on your side. All three come with the approval guarantee and 24/7 human support.
$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$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$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 byWinter Sale prices valid until December 31, 2026.
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.