Run App Inventor Block Via Link

How do I run an AI2Offline (App Inventor) block via a link in a webviewer. Not CustomWebView.

Hello Chippy

AI2Offline is not our product, we do not support it.

What action exactly?

I meant block

Do you mean you want to trigger an action in your App via a web page (javascript)?

Yes

From the help:

Component for viewing Web pages. The Home URL can be specified in the Designer or in the Blocks Editor. The view can be set to follow links when they are tapped, and users can fill in Web forms. Warning: This is not a full browser. For example, pressing the phone's hardware Back key will exit the app, rather than move back in the browser history.

You can use the WebViewer.WebViewString property to communicate between your app and Javascript code running in the Webviewer page. In the app, you get and set WebViewString. In the WebViewer, you include Javascript that references the window.AppInventor object, using the methoods and setWebViewString(text).

For example, if the WebViewer opens to a page that contains the Javascript command
document.write("The answer is" + window.AppInventor.getWebViewString());
and if you set WebView.WebVewString to "hello", then the web page will show
The answer is hello.
And if the Web page contains Javascript that executes the command
window.AppInventor.setWebViewString("hello from Javascript"),
then the value of the WebViewString property will be
hello from Javascript.

Is the when Screen1 Timer block removed?

Are you referring to App Inventor Classic?

No, App Inventor 2

There are only Clock Timer Blocks, they are not dedicated to a specific Screen.

blockClock

Edit: Find Clock in the Sensors Palette

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.