Corova cordona plugin not working

I really want to grab a web link that can launch my launcher app. I am using the code as shown below. [written in AndroidManifest.xml].

<intent-filter>
    <action android:name="android.intent.action.VIEW" />    
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />                   
    <data
        android:host="mysite.com"
        android:pathPrefix="/_mobile/"
        android:scheme="http"                   
    />              
</intent-filter>

      

The application launch is successful when I try to visit "mysite.com/_mobile". Basically, the above link is actually a link to the mobile version of my main website. Now, if the user has installed the app, they should open the app, not the mobile web page. So far this works great. Now the problem is when I want to navigate to a specific page in the application. for example "mysite.com/_mobile?productId=103" - this will open the page for productId = 103 in the mobile web view. But, if the user has installed my application, how can I redirect it to the productId page in the application. I did some searches on this topic and came across the cordova plugin. I have added this plugin so called "Initsogar / cordova-webintent" here .Now I am using this code,

window.plugins.webintent.getUri(function(url) {
    if(url !== "") {
        alert("URL was "+url);
    }
});

      

All I want is to get the uri that started the application. I am not getting the desired result. I tried to alert some value to check if this code works or not, it seems it does NOT. see the code i used for testing:

window.plugins.webintent.getUri(function(url) {
  alert(2);    
  if(url !== "") {                
     alert("URL was "+url);
  }         
}); 

      

Here 2 is not warned. I don't know what happened to this plugin. other than that, I don't know where to start. any help would be great. :)

+3


source to share





All Articles