send message and open App after ckick 'OK'
- 02 June 2020
- SOTI MobiControl
12 Answers- 0 Upvote
- 3 Followers
12 Answers
Hello,
We d like more info about your configuration -> mobicontrol version / device mark / ...
But on the doc for version 14 on mobicontrol I read that it's possible but never try
here is it the doc -> search after showmessagebox
soti.net/mc/help/v14.0/en/scriptcmds/reference/androidplus.html
Thanks
Thx I found but i not found start app
just send an intent … I think
see doc about mobicontrol script and command sendintent
Hi Rathasatekun,
As suggested by Christophe, please follow the below help file for The sendintent Command to start an activity(open an application) when the device user clicks on 'OK' on the device:
https://www.soti.net/mc/help/v15.1/en/scriptcmds/reference/sendintent.html
An sendintent script command requires two parameters: the type of intent and the intent URL.
The type of intent can be an activity (-a), a service (-s), or a broadcast (-b).
The intent URL is composed using one of two different kinds of syntax. Either the intent URI, which uses conventional URI format, or using the following format:
"intent:[dataURI]#Intent;[schemeOfTheDataURI];[action=];[component=];[category=];[launchFlags=];[extraKeyValuePair=];end"
For example,
Regards,
Technical Support | SOTI Inc. |+1-888-494-SOTI (7684) | support@soti.net | www.soti.net |
Hi I try script but script not work as Details Below
My server
My Client Mobicontrol 14.2.1 Build 1083
mobicontrol version Version: 15.0.2.1049
My Tested Device Samsung Model SM-A750GN
1. I tested Script messagebox it's OK
if %ShowMessageBoxReturn% == IDYES goto sendintent -a "https://www.google.com#Intent;action=android.intent.action.VIEW;end" EXIT
i have more problem
I can open app with sendintent but i have problem that
I use
sendintent -a "intent:#Intent;action=android.intent.action.MAIN;component=android.intent.category.APP_CALENDAR;end"
and
Why my device open Gallery How to clear cache or something and exe it to correct?
i have more problem
I can open app with sendintent but i have problem that
I use
sendintent -a "intent:#Intent;action=android.intent.action.MAIN;component=android.intent.category.APP_CALENDAR;end"
I change to other component but it open Gallery App only
and Sendmessagebox still cannot exe sendintent after press OK/YES
Hi Support
I have been tested script and i found problem as below
Details
Android enterprise
My Client Mobicontrol 14.2.1 Build 1083
mobicontrol version Version: 15.0.2.1049
Problem Details
Script1
showmessagebox "OPEN APP?" NO_TIMER 2 YES
if %ShowMessageBoxReturn% == IDYES goto sendintent -a "intent:#Intent;action=android.intent.action.MAIN;component=android.intent.category.APP_MESSAGING;end"
Message show but click YES not open APP
Script2
sendintent -a "intent:#Intent;action=android.intent.action.MAIN;component=android.intent.category.APP_MESSAGING;end"
sendintent -a "intent:#Intent;action=android.intent.action.MAIN;component=android.intent.category.APP_CALENDAR;end"
It open only Gallery APP
Hi Rathasatekun,
Is your app to be run very special or did I miss anything from your post? Do you know the bundle ID of the app you want to start? If so, just use the "start" script command. I just can't think of any reason why an intent should be used in such case.
Regarding the conditional showmessagebox script command involving OK button, my tests since its introduction many months ago have never given any positive result in changing script program flow. However, as DDMOD told you in a post to use intent after clicking the OK button, I believe you can ask him/her to give an actual script example and test conditions that can have conditiional program flow done successfully. I myself love very much to learn how to use this new feature too.
Hello Rathasatekun,
Following up on this thread, were you able to resolve the issue? If yes, I would like to know what were the steps taken to resolve the issue and I can mark that as a Solution.
Regards,
Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |
Hi Rathasatekun,
With the new features recently added to javascript engine, you might have the option to use equvalent of showmessagebox script command if your Android device agent is recent enough to have such features supported (Note : The MobiControl server version is not significant) . In particular, the following namespace/methods together with conditonal construct in the javascript language should solve your problem:
mobicontrol.message.createOkCancelDialog
mobicontrol.message.createYesNolDialog
mobicontrol.app.start
For details of the latest features, check the online doumentation at
mobicontrol.message.createYesNoDialog('Would you like to open the app now?').withCallback(onConfirm).show();
function onConfirm(result) {
if (result.isYesButton) {
mobicontrol.log.info('The Yes button was clicked');
mobicontrol.app.start('YOURAPPPACKAGENAME');
} else if (result.isNoButton) {
mobicontrol.log.info('The No button was clicked');
} else if (result.isDismissed) {
mobicontrol.log.info('The dialog was dismissed');
}
}