Community
cancel
Showing results for 
Search instead for 
Did you mean: 
265 Views

link to open in google play using cordova

Hello

I have 2 app into google play

I want to create a link from app 1 to open app 2 from using google play app on customer smartphone

Open https://play.google.com/store/apps/details?id=com.Conteudo_Animal_pro

app1 index.html
.....
<p class="align-center">Área de Profissionais do Ramo e Assessoria de Imprensa</p>
 <input type="button" style="width:100%" id="id_incluir" value="Baixe nossa App para Incluir Contéudo !">
......

app1 app.js

.....
function onAppReady() {

    if( navigator.splashscreen && navigator.splashscreen.hide ) {   // Cordova API detected
        navigator.splashscreen.hide() ;
    }
el = document.getElementById("id_incluir") ;
el.addEventListener("click", eventIncluir, false) ;    

}

var eventIncluir = function() {

    var url = "https://play.google.com/store/apps/details?id=com.Conteudo_Animal_pro" ;
    var target = "_self" ;              // or "_blank" or "_system", see docs for more
    var options = "location=off" ;      // see docs for more 
    var ref = cordova.InAppBrowser.open(url, target, options) ;
}
....

 

 

Tags (2)
0 Kudos
4 Replies
PaulF_IntelCorp
Employee
265 Views

Not clear what the issue is. Please explain what is not working.

265 Views

Hello,

When I click on link I got the error on attached image 

It is on my own language so lets translate

"This brownser is not compatible, Use Google Play app to access Google Play "

So How to write the code to access google play app to my customer install my app 2 ??

thanks in advance

PaulF_IntelCorp
Employee
265 Views

Based on that error message, I recommend that you tell the inAppBrowser to open the page using the device browser, and do not open it inside your app's webview. I believe that means using this:

var target = "_system" ;

But double-check the documentation to be sure.

The method you're using now, which I believe is opening in the app webview, may not work at all with that web site or it may only work if you're using an Android 5.x or later device. That method might work if you are using the Crosswalk webview ("optimize for Crosswalk" option). I can't say for sure because I don't know what they are checking for and I haven't looked at the inAppBrowser docs recently to double-check.

265 Views

Hello

Worked fine

I just need to tell customer to complete action using Google Play app :-)

Thanks a lot

Marcos 

 

Reply