Page 1 of 1

Sending USSD Codes from my LiveCode App to my Mobile Phone Carrier

Posted: Thu Aug 27, 2020 2:06 am
by wmiriye
I am having a challenge in trying figure out how to send USSD codes in the background to the local mobile phone carrier (in this case, Digicel) and then getting the response and displaying for the user in the App.

Instead of the user going through and punching in all the number sequence for each text/message based menu, I want to "automate" the process where the user can just press a menu on the app, and all the sequences are taken care in the background and the result is displayed on the app.

I tried using the: (translation: "*120#)

Code: Select all

)
put "tel:*120%23" into tNum
      launch url tNum
But it only solves one problem. It loads the number and the keypad shows up but does not automatically dial the number (I am checking the android permissions to make sure "android.permission.CALL_PHONE" returns true. Still, it does not auto dial.

Secondly, it only accepts the first sequence of numbers. I want it to go through the whole sequence, for example like:

Code: Select all

put "tel:*120%23*1*2*!" into tNum
      launch url tNum
This should return the final response from the carrier which I can display to the user.

The asterisks separate the string number sequence required to dial USSD codes per online documentations. However, this gives an error using this approach. The cell phone provider does not accept this.

Summary

1. How do I launch my phone number and then automatically dial the USSD code?

Possible Solutions

Solution 1. Is it possible to simulate a mouse click like

Code: Select all

click at <loc>
If that is the case, how can I find the location of the dial pad and position of each number on the pad. How can I leverage LiveCode to find the location and the simulate mouse clicks, and dial.

Solution 2. Any easier insights/third party insights from experiences/expert android developers.

On a side note, while researching, I found something called "LiveSend" but the url links are not working: https://messaging.livecode.ae
Anyone know, what happened to LiveSend and is there another valid link for this? This looks exactly like something I need to read up on.

Thank you all so much!

Re: Sending USSD Codes from my LiveCode App to my Mobile Phone Carrier

Posted: Thu Aug 27, 2020 9:39 am
by sphere
If i remember correct then
Android does not auto-dial when using launch "tel:1234567890", but iOs does auto-dial

at least that is what i noticed, but it's a while ago

Re: Sending USSD Codes from my LiveCode App to my Mobile Phone Carrier

Posted: Thu Aug 27, 2020 10:08 am
by wmiriye
yes, I noticed that as well. That is why I am asking.... :(

Re: Sending USSD Codes from my LiveCode App to my Mobile Phone Carrier

Posted: Thu Aug 27, 2020 5:44 pm
by sphere
I have no idea how to change that behaviour, maybe someone will chime in with a solution.

Re: Sending USSD Codes from my LiveCode App to my Mobile Phone Carrier

Posted: Thu Aug 27, 2020 8:00 pm
by jiml
This might help:
https://developer.android.com/guide/com ... nts-common
To place a phone call directly, use the ACTION_CALL action and specify a phone number using the URI scheme defined below. When the phone app opens, it begins the phone call; the user does not need to press the Call button.

The ACTION_CALL action requires that you add the CALL_PHONE permission to your manifest file:

<uses-permission android:name="android.permission.CALL_PHONE" />
Guess that means the manifest file needs to be edited. Not sure if or how to do that with LiveCode.

Hope this helps.

Jim Lambert

Re: Sending USSD Codes from my LiveCode App to my Mobile Phone Carrier

Posted: Thu Aug 27, 2020 8:34 pm
by sphere
you need to create a manifest file yourself and include it via the standalone settings.
Then LC should merge it with "master" manifest it creates while making the standalone

(i've not done that yet myself, but this is what i know and have read in a lesson and/or one of the releasenotes)

Re: Sending USSD Codes from my LiveCode App to my Mobile Phone Carrier

Posted: Fri Aug 28, 2020 7:47 pm
by wmiriye
Thank you, I'll look into that.