iOS Question perform a call from the app? b4i

ilan

Expert
Licensed User
Longtime User
hi,

does anyone know if its possible to perform a call from the app by pressing on a button??

thanx
 

ilan

Expert
Licensed User
Longtime User
thanx erel, i must tell you i really enjoy b4i, this is a wonderfull tool. i never thought it would be so easy to develop for ios

the only thing i really hate on b4i is that i cannot stand up from my pc :D (i am officially addicted to b4i)
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
How to I put <VAR> string instead of the number you wrote?
is this will work?
If App.CanOpenURL("tel:") Then App.OpenURL("tel:" & Number )
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
How to I put <VAR> string instead of the number you wrote?
is this will work?
If App.CanOpenURL("tel:") Then App.OpenURL("tel:" & Number )

Yes it should work, i do it like this:

B4X:
Dim phonenumber As String 
phonenumber = "0505552222"

If App.CanOpenUrl("telprompt:" & phonenumber) = True Then
    App.OpenURL("telprompt:" & phonenumber)
End If
 
Upvote 0

Taha

Member
Licensed User
Longtime User
I've got unexpected error: "LaunchServices: ERROR: There is no registered handler for URL scheme (null)". Added this line but without success.
B4X:
#QueriesSchemes: tel
 
Upvote 0

Taha

Member
Licensed User
Longtime User
Ok, the issue could be resolved by modifying the above code as follows:
B4X:
Dim phonenumber As String
phonenumber = "telprompt:0505552222"

If App.CanOpenUrl(phonenumber) = True Then
    App.OpenURL(phonenumber)
End If
Also, removed spaces and parenthesis.
 
Upvote 0

manolitoGnet

Member
Licensed User
Longtime User
Knows anybody if this error is related to the use of the emulator?

-canOpenURL: failed for URL: "tel:632222222" - error: "This app is not allowed to query for scheme tel"

B4X:
Sub Button1_click
    Private phonenumber As String
   
    phonenumber = "tel:632222222"

    If App.CanOpenUrl(phonenumber) = True Then
           App.OpenURL(phonenumber)
    End If
End Sub

Tx
 
Upvote 0

manolitoGnet

Member
Licensed User
Longtime User
Knows anybody if this error is related to the use of the emulator?

-canOpenURL: failed for URL: "tel:632222222" - error: "This app is not allowed to query for scheme tel"

B4X:
Sub Button1_click
    Private phonenumber As String
  
    phonenumber = "tel:632222222"

    If App.CanOpenUrl(phonenumber) = True Then
           App.OpenURL(phonenumber)
    End If
End Sub

Tx

An now: -canOpenURL: failed for URL: "tel:632222222" - error: "(null)"

:(
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
Knows anybody if this error is related to the use of the emulator?

-canOpenURL: failed for URL: "tel:632222222" - error: "This app is not allowed to query for scheme tel"

B4X:
Sub Button1_click
    Private phonenumber As String
  
    phonenumber = "tel:632222222"

    If App.CanOpenUrl(phonenumber) = True Then
           App.OpenURL(phonenumber)
    End If
End Sub

Tx

just remove "tel:" from your phone number
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
No, this is not the way...

B4X:
-canOpenURL: failed for URL: "632222222" - error: "Invalid input URL"

The protocol is a must.

Tx

have you seen my post above??

this is how i do it:

B4X:
Dim phonenumber As String
phonenumber = "0505552222"

If App.CanOpenUrl("telprompt:" & phonenumber) = True Then
    App.OpenURL("telprompt:" & phonenumber)
End If
 
Upvote 0

manolitoGnet

Member
Licensed User
Longtime User
now i see that u r using an emulator. i dont think that phone calls can be performed from an emulator!!
you should try your code on a real phone

Yeah, that is my very first question... I have not an iPhone, only 4 iPad and the Simulator from Xcode.

Thanks for your effort!
 
Upvote 0
Top