Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - How to open the Hangout app from a Hangout URL displayed in the webview?

I just made an Android app where I am displaying my website in a webview.
My webpage has many links to Google Hangouts URL (https://talkgadget.google.com/hangouts/_/g23uuqx.......) in which there are people in a call.

enter image description here

When this link is clicked on a Desktop's browser, the URL gets opened in a new tab and the user is able to join the Google Hangout call.

When this link is clicked on a Mobile's browser, the hangout app get's opened and the user is able to join the call. How can have the same effect when the link is clicked in WebView?

When I open the hangout URL in mobile app(webview), it opens the google play webpage in my app(webview) and asks me to install hangout which I already have installed.

enter image description here

Instead of going to google play store within the webview of my app,

(When Google Hangouts app is installed on the Android phone)
1) How do I open the hangout app from my app which has hangout URLs of this form(https://talkgadget.google.com/hangouts/_/g23uuqx.......) in the webview of my app?

(When Google Hangouts app is not installed on the Android phone)
2) How to open Google playstore app and inform the user to Install Google Hangout app in order to join the call?

Kindly help. Thanks.

like image 233
New to Rails Avatar asked Oct 20 '22 11:10

New to Rails


2 Answers

You can use WebViewClient.shouldOverrideUrlLoading to catch these links and then start an appropriate activity. A good example of how to launch the Google Play app this way is described here: Allow all 'market://' links from inside a webview to open Google Play store

like image 173
Mikhail Naganov Avatar answered Oct 22 '22 00:10

Mikhail Naganov


TL;DR

  1. Install (or Enable) Chrome.app on your device.
  2. [Optional] Clear defaults from all browsers.
  3. Touch any hangouts link—this could be from within an app like Calendar.app
  4. Choose to [always] open the link with Chrome.app

This is more a browser-wars thing than anything else. Below is my solution from a user perspective.

I saw a monkey-path fix on Google's Product Forums which advises us to manually type in the Hangouts link into Google Search. This works. This would open Hangouts, ask for authentication with the account you wish to use (assuming you have multiple Google accounts on your phone), and lead you straight to the call on Hangouts. This, however, is cumbersome.

Then I thought about browser wars and decided to re-enable Chrome on my device. E voilá! Now, clicking on any Hangouts link from any app (in my case "Calendar") and choosing to open that link with Chrome takes you straight to the Hangouts call in the Hangouts.app

like image 43
Igbanam Avatar answered Oct 22 '22 02:10

Igbanam