Invoke Calls from inside app

Hi, me again.

Just wondering whether is it possible to invoke phone call from inside the app? For example I have a button and when user click on it, they can be directed to the phone call pad with the phone number already in place?

You can do this by using the Open URL flow function with the tel: protocol, i.e. tel:555-1234567. This will invoke the native “make a phone call” dialog.

I don’t think there’s any native way to switch to the phone app with the number in place; the different Contacts category flow functions will let you e.g. init adding a contact though.

Hi @Harri_Sarsa, this works perfectly on iOS, but on android, it keeps on giving me a wrong number on the dial pad. Is it is different on Andriod?

It should work the same on Android also. I also tried it and didn’t see any issue there. Are you trying with a static number or is it taken from data or from a Formula? If it’s from data, you could debug the issue by alerting the number before opening the URL to make sure the number is actually correct when you try to use it.

It’s from data, using the formula, I actually tried debugging, the number is fetched from an output of a http call, I used a dialog view to see whether it catches the number, but it’s showing an empty dialog. tried everything I could. Just no luck. :pensive:

Have you tested that the HTTP request actually outputs the number? If you alert the whole output record with ENCODE_JSON, does it include the phone number as it should?

I haven’t tried ENCODE_JSON yet. let me try that and get back to. you. Thanks @Tomi_Laakso

Hi @Tomi_Laakso I tried encode_json to convert the number to a string, didn’t give me any positive results, so I reverted to the last working state.

What I’m trying to do:
I have a button on the bottom nav which says “Find Number”, when a user taps on it I take the users GPS latitude and longitude make a HTTP request to an external source which will return a json object which consists of a mobile number that can be returned to the user. I’m also saving that call log, to collect data.

What I have done:
when user taps the “find number” button, I collect their GPS coordinates.
saves the latitude and longitude into two-page variables, and use the formula to define those two variables inside an HTTP post request to an external URL, once the call is done, I collect the output result and save them to an app variable. Next, I do an API call to create an object with the app variables to save them as call logs in my backend DB. after that I use “open URL” to return the mobile number to the user.

So far it works on ios, the record is saved as it should the number is returned too for the ios user, but doesn’t work on Android, only data saved on the backend by the android user are the coordinates and the user ID. The number returns empty.

Hi, I’ve been trying to figure this out a couple of times now, but I don’t have have a definitive answer still.

On Composer side your Page variables are type Integer text and GPS Location returns type Numbers so the current configuration setting those warns you that those are incompatible. But I think fixing that won’t help with the overall problem.

So I’d look at your API end point since it doesn’t work for me on iOS either and I cannot get any response (other than error) even when I make the request from my browser. So without getting a real response, I cannot debug this further.

1 Like

@Tomi_Laakso you’ll get an error if you try with your current coordinates, it only works if the coordinates are from certain polygons I’ve set on the backend. That’s why you’re getting errors even on web. I can give you coordinates that will give you a successful response.

Also, I’ve changed the integer text to the “number” type. I’ll let you know if this change works on Android. It still works on ios.

Hi @Ahmed_Aman does the issue persist or is all good now? Just wondering if you still needed help with this :blush:

It’s still not working I’m almost about to give up now. :pensive: :sleepy:

will you be able to help me?

Yep, I can try. Can you tell me the coordinates that will give a successful response from backend? And is it okay if I make some minor changes to your app while I try to debug the issue?

Of course, you can make the changes you need. Thanks again :blush: