Open defined URL after clicking OK Button in Messagebox

M
Maximilian
COSYS Ident GmbH

I use Android Enterprise Devices (Zebra TC57 + TC27) on MobiControl 15.1.

I want to open a defined URL with chrome after clicking the OK button.

This script just opens chrome, because i cant find a way to define a URL...

var buttonLabels = ['OK'];
mobicontrol.message.createInfoDialog('Text for Messagebox').withButtons(buttonLabels[0]).withCallback(onConfirm).show();

function onConfirm(result) {
if (result.buttonIndex != null) {
mobicontrol.log.info('The OK button was clicked');
mobicontrol.app.start('com.android.chrome');
}
}

This old sendintent script works fine but there's no way to put this in a showmessagebox.

sendintent -a "https://google.com#Intent;action=android.intent.action.VIEW;end"

3 years ago
Android Scripting
ANSWERS
RC
Raymond Chan Diamond Contributor
3 years ago

You are right that Legacy MobiControl script engine and javascript engine in the latest AE device agent supports different features and something that has solution with legacy script has no counterpart in the more recent javascript script.  I have voiced out the problems to Soti many many months ago, and there have been some progress in various aspects.  Unfortunately, your current problem does not seem to have any direct solution yet with the latest javascript engine implementation.

M
Maximilian
3 years ago

Do you've any idea to use the sendintent in a legacy script with showmessagebox?

Similar Discussions