iOS Question Share Simple Text With Whatsapp

Discussion in 'iOS Questions' started by tufanv, Aug 15, 2018.

  1. tufanv

    tufanv Expert Licensed User

    Hello,

    I have searched the forum a bit but couldn't find an appropriate answer. I want to share a simple text with whatsapp. I think openapp is no longer possible after ios 9. Is there any code snippet that works currently wo share a text with whatsapp?

    (there is a method here but I just want to make user use whatsapp so not able to use this : https://www.b4x.com/android/forum/t...pp-with-activityviewcontroller.73159/#content)

    TY
     
  2. tufanv

    tufanv Expert Licensed User

    I found the solution:

    add this:
    #QueriesSchemes: whatsapp

    Code:
    Dim txt As String = "Hello%2C%20World!"
    Dim url As String = "whatsapp://send?text=" & txt
    If App.CanOpenUrl(url) Then App.OpenUrl(url)
    my only question is , if whatsapp is not present in the phone , will the app crash or do nothing ?_
     
  3. Filippo

    Filippo Expert Licensed User

    Probably only the message "whatsapp is not installed".
    I also get the message when sending e-mail because I did not configure an e-mail.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    App.CanOpenUrl will return False if whatsapp is not installed.

    Not true. The only change is that you need to declare the scheme with #QueriesSchemes.
     
    tufanv likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice