Saltar al contenido
Transform To APP
FuncionesCómo funcionaPreciosCómo publicarPreguntas
EntrarCrear mi app
window.TTA

API para desarrolladores — window.TTA

Tu web controla funciones nativas reales directamente — el mismo código funciona en iOS y Android. Sin SDK, sin recompilar: solo llámalas desde tu web.

Detectar la app

Tu web funciona en un navegador normal y dentro de la app. Comprueba window.TTA antes de usar funciones nativas para que la web siga funcionando en todas partes.

if (window.TTA) {
  // inside the native app
} else {
  // normal browser — your web fallback
}

Métodos

Los métodos marcados como “opt-in” solo existen si activas esa función en el builder — detecta siempre la disponibilidad.

window.TTA.platform

'ios' or 'android' — tells your site it runs inside the native app.

if (window.TTA) {
  console.log('Running natively on', window.TTA.platform);
}
window.TTA.haptic()

Native haptic / vibration feedback on a tap or action.

button.addEventListener('click', () => window.TTA?.haptic());
window.TTA.share(url?)

Open the native share sheet. Defaults to the current page URL.

window.TTA?.share('https://example.com/product/42');
window.TTA.rate()

Show the native App Store / Google Play review prompt.

window.TTA?.rate();
window.TTA.openExternal(url)

Open a link in the in-app browser instead of leaving your app.

window.TTA?.openExternal('https://help.example.com');
await window.TTA.scan()opt-in · Scanner

Open the full-screen native QR / barcode scanner. Resolves to {text, format} or null if cancelled.

const result = await window.TTA.scan();
if (result) alert('Scanned: ' + result.text);
window.TTA.logEvent(name, params?)opt-in · Analytics

Send a custom analytics event (Insights). 'app_open' is tracked automatically.

window.TTA?.logEvent?.('add_to_cart', { id: 'sku_42', value: 9.99 });
await window.TTA.getProducts()opt-in · In-app purchases

Fetch your in-app products: [{ id, title, price, priceValue, currency }].

const products = await window.TTA.getProducts();
products.forEach(p => renderPrice(p.id, p.price));
await window.TTA.purchase(productId)opt-in · In-app purchases

Launch the native purchase flow. Resolves to { success, productId, transactionId } or { success:false, cancelled }.

const r = await window.TTA.purchase('com.app.pro.monthly');
if (r.success) unlockPro();
await window.TTA.restorePurchases()opt-in · In-app purchases

Return the product IDs the user already owns (restore entitlements).

const owned = await window.TTA.restorePurchases();
if (owned.includes('com.app.pro.monthly')) unlockPro();

Funciona automáticamente

Con la función correspondiente activada, las APIs web estándar funcionan dentro de la app: navigator.geolocation (Ubicación), cámara getUserMedia para librerías web de QR (Cámara), <input type=file> y descargas de archivos.

Crea tu app con estos superpoderes

Abrir el builder
Transform To APP

La plataforma nº1 para convertir webs en apps nativas.

[email protected]

Producto

  • Funciones
  • Precios
  • Cómo funciona
  • Cómo publicar
  • Desarrolladores

Empresa

  • Sobre nosotros
  • Contacto
  • Blog

Legal

  • Privacidad
  • Términos
  • Cookies
© Transform To APP. Todos los derechos reservados.transformtoapp.com