BlocosIA Wiki Editor

Start.io ads in your app (WebView)

Is it possible? Yes, through the app that opens the project. See how to connect the WebView to the Start.io SDK.

Can Start.io be used in a WebView?

Start.io offers native SDKs (Android, iOS, Unity, Flutter) โ€” the latest Android version on Maven Central is 5.4.0 โ€” and has no SDK for web pages. So the ad cannot be loaded inside the HTML: the app that opens the project in a WebView shows it. The Ads (Start.io) extension is the bridge: the project asks, the app shows and reports back. In the editor, ads are simulated.

In the project

  • show full-screen ad (interstitial), rewarded video, splash or exit.
  • show the banner at the bottom/top.
  • when the ad gives the reward โ†’ give the extra life; when the ad is closed โ†’ continue the game.
  • wait at least 60 seconds between full-screen ads avoids annoying the player.

In Kodular / App Inventor

  1. Export the project as HTML and open it in the WebViewer (file in Media or an https address).
  2. Add a Start.io extension and initialize it with your App ID (Start.io publisher portal).
  3. WebViewer.WebViewStringChange event: the value is a JSON like {"blocosia":"anuncio","acao":"mostrar","formato":"recompensa"}. Read acao (mostrar, banner, carregar, teste, consentimento) and formato (intersticial, recompensa, splash, saida) and call the extension block.
  4. In the extension events (closed, reward, failed), notify the project: WebViewer.RunJavaScript (App Inventor) or Evaluate JavaScript (Kodular) with blocosiaAnuncio('recompensa'). Events: pronto, carregado, mostrado, fechado, recompensa, falhou.

Android Studio

webView.addJavascriptInterface(object, "BlocosIAAnuncios") with the method @JavascriptInterface pedido(String json), and webView.evaluateJavascript("blocosiaAnuncio('fechado')", null) to answer. On iOS: webkit.messageHandlers.blocosiaAnuncios.

Be careful

  • For apps aimed at children, Google Play rules (Families program) only allow ad SDKs certified for that audience: check whether Start.io is accepted before publishing.
  • Ask for user consent (GDPR/LGPD) and use test ads while developing.