iOS Question B4i code for w.a. chat and phone call

luke2012

Well-Known Member
Licensed User
Hi all,
In the B4A version of the app (using B4XPages framework from @Erel) I created a two buttons that directly opens a WhatsApp chat and a phone call with a specific recipient number that I pass as a parameter (see CODE1 and CODE2 below).

The question is: "which is the corresponding code for B4i version (#if B4i) ?

B4X:
'CODE 1...
    #if B4A
        private phonenum as string = "000000000000"
        private WA_URI as string = "https://wa.me/" & phonenum
        Private p As PhoneIntents
        StartActivity(p.OpenBrowser(WA_URI))
    #End If
 
    #if B4i
       '..... ?
    #End If

B4X:
    'CODE 2...
    private phonenum as string = "000000000000"
    If phonenum = "" Then
        toast.VerticalCenterPercentage = 50
        toast.Show("......")
        Return
    Else
        #if B4A
        Dim i As Intent:i.Initialize(i.ACTION_VIEW, "tel:" & phonenum)
            StartActivity(i)
        #End If
  
        #if B4i
      
        #End If
    End If
 
Last edited:

hatzisn

Well-Known Member
Licensed User
It is not easy. The closer you can get is the Social Share library which you can find in my signature's "My contributions..." link.

For phone call just use Main.App.Openlink(sTelLink)
 
Upvote 0

luke2012

Well-Known Member
Licensed User
It is not easy. The closer you can get is the Social Share library which you can find in my signature's "My contributions..." link.

For phone call just use Main.App.Openlink(sTelLink)

Hi @hatzisn ,
thanks for your reply :)

1) "For phone call just use Main.App.Openlink(sTelLink)" ---> you mean "Main.App.OpenURL(sTelLink)"
- If a use .Openlink I got an error that says like this : "this method doesn't exist..."
 
Upvote 0
Top