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

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
wmiriye
Posts: 24
Joined: Tue Jun 02, 2020 4:09 am

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

Post by wmiriye » Thu Aug 27, 2020 2:06 am

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!

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

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

Post by sphere » Thu Aug 27, 2020 9:39 am

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

wmiriye
Posts: 24
Joined: Tue Jun 02, 2020 4:09 am

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

Post by wmiriye » Thu Aug 27, 2020 10:08 am

yes, I noticed that as well. That is why I am asking.... :(

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

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

Post by sphere » Thu Aug 27, 2020 5:44 pm

I have no idea how to change that behaviour, maybe someone will chime in with a solution.

jiml
Posts: 336
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

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

Post by jiml » Thu Aug 27, 2020 8:00 pm

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

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

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

Post by sphere » Thu Aug 27, 2020 8:34 pm

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)
Last edited by sphere on Sat Aug 29, 2020 3:48 pm, edited 1 time in total.

wmiriye
Posts: 24
Joined: Tue Jun 02, 2020 4:09 am

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

Post by wmiriye » Fri Aug 28, 2020 7:47 pm

Thank you, I'll look into that.

Post Reply

Return to “Android Deployment”