I want to open Google play games app on my mobile from my android phonegap build application using WEBINTENT plugin.
window.plugins.webintent.startActivity({
action: window.plugins.webintent.ACTION_VIEW,
url: 'facebook://'
},
function() {alert('success')},
function(errorMsg) {alert('Failed to startActivity errorMsg=' + errorMsg)}
);
},false);
This code works well to open facebook. How to use it to open play games application.? Thanks.
web intent plugin can only open apps that have an url scheme to open it.
if the games you want to open don't have an url scheme, then you can't open them with the web intent plugin
You can use the startapp plugin to open apps using the package name
https://github.com/lampaa/com.lampa.startapp
To use it on phonegap build, add this on the config.xml
<gap:plugin name="com.lampa.startapp" source="plugins.cordova.io" />
To open an app use this code:
navigator.startApp.check("com.package.name", function(message) { /* success */
console.log(message); // => OK
},
function(error) { /* error */
console.log(error);
});