Android-SmartWebView icon indicating copy to clipboard operation
Android-SmartWebView copied to clipboard

Whatsapp application are not showing up

Open riyazahmad97 opened this issue 5 years ago • 3 comments

Describe the bug A clear and concise description of what the bug is, better if you can attach a log.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Device (please complete the following information):

  • Device name/variant: [e.g. Samsung Galaxy, J2]
  • Build [e.g. arm, x86]
  • Android Version [e.g. API 27 or Oreo]

Additional context Add any other context about the problem here.

riyazahmad97 avatar Apr 06 '19 10:04 riyazahmad97

Hi,

In my application, i have allowed user to share via whatsapp, facebook and twitter. When i click on share with facebook, it jumps to the browser look facebook and not the facebook application in my mobile. The same thing happen for twitter. But for whatsapp, it jumps to error.html.

Here's my code.

HTML Code: <a href="whatsapp://send?text=HERE GOES THE URL ENCODED TEXT YOU WANT TO SHARE" data-action="share/whatsapp/share"> <i class="fa fa-whatsapp whatsapp-color"></i> Whatsapp </a>

Java file (SmartWebView.java):

` //Permission variables

static boolean ASWP_JSCRIPT     = true;     //enable JavaScript for webview
static boolean ASWP_FUPLOAD     = true;     //upload file from webview
static boolean ASWP_CAMUPLOAD   = true;     //enable upload from camera for photos
static boolean ASWP_ONLYCAM		= false;    //incase you want only camera files to upload
static boolean ASWP_MULFILE     = false;    //upload multiple files in webview
static boolean ASWP_LOCATION    = true;     //track GPS locations
static boolean ASWP_RATINGS     = true;     //show ratings dialog; auto configured, edit method get_rating() for customizations
static boolean ASWP_PBAR        = false;    //show progress bar in app
static boolean ASWP_ZOOM        = false;    //zoom control for webpages view
static boolean ASWP_SFORM       = false;    //save form cache and auto-fill information
static boolean ASWP_OFFLINE     = false;    //whether the loading webpages are offline or online
static boolean ASWP_EXTURL      = false;     //open external url with default browser instead of app webview`

Hope to get response from you. Thanks.

riyazahmad97 avatar Apr 06 '19 10:04 riyazahmad97

You are providing a custom protocol to the system, i.e, whatsapp://. Webview doesn't know if you're asking for an app so it is handling it as a basic web protocol, which it isn't and throws error.

You need to specify in the program how you want to handle a specific protocol or open apps on certain link redirects.

mgks avatar Apr 07 '19 06:04 mgks

okay thanks @mgks for your reply.

i have seen https://stackoverflow.com/questions/35316854/webview-on-android-whatsapp-share. Im still new in android web view, do you know where should i paste the code?

Thanks for your time.

riyazahmad97 avatar Apr 07 '19 10:04 riyazahmad97