Mini App join funnel: startapp sponsor attribution + wallet-app handoff
- /app decodes startapp=<sponsorId>[_<angle>] -> unlinked visitors land on the sponsor squeeze page /join/<ref>?src=miniapp (linked members still go to their dashboard); no-invite prospects get a gold Join button -> /join-now - tg-app.js: sync __rmcInTg flag; external links route out of the webview via openLink/openTelegramLink (wallet deep links reach the wallet app reliably) - join-now.js in the webview leads with the MetaMask/Trust deep links (no injected wallet can exist there); ref + src survive into the wallet browser - tgbot: links command + weekly digest include the t.me/<bot>/<short>?startapp Telegram-native invite once config.miniAppShortName is set (new PATCH key) - Synced chat.js canned answer + AI prompt (prospects can join from the app) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -191,6 +191,15 @@ fetch('/api/public/config').then(function(r){return r.json()}).then(function(c){
|
||||
}
|
||||
document.addEventListener('DOMContentLoaded',function(){
|
||||
loadSponsor();
|
||||
// Telegram Mini App webview: no wallet can ever be injected here, so lead
|
||||
// with the deep links immediately — the join finishes in the wallet app's
|
||||
// own browser (same page, sponsor + attribution carried in the URL).
|
||||
if(window.__rmcInTg){
|
||||
showWalletHelp();
|
||||
var hd=$('walletHelp')&&$('walletHelp').firstElementChild;
|
||||
if(hd)hd.textContent='📱 One tap to finish in your wallet app.';
|
||||
log('You’re in Telegram — joining happens in your wallet app’s secure browser. Tap your wallet above; this page reopens there with your sponsor already set.','ok');
|
||||
}
|
||||
$('connectBtn').addEventListener('click',connect);
|
||||
$('joinBtn').addEventListener('click',doJoin);
|
||||
var fb=$('fundBtn'); if(fb)fb.addEventListener('click',openMoonpay);
|
||||
|
||||
Reference in New Issue
Block a user