This post is a part 14 of Intel XDK Complete Tutorial post series.
With just one line of code you can install or run an application
Running or Installing Android app
//Parameters: app name, protocol handler, app location, bundle id
intel.xdk.device.runInstallNativeApp('Boom Town', 'applab.boomtown://', 'market://details?id=com.intel.xdk.applab.boomtown', 'com.intel.xdk.applab.boomtown');
intel.xdk.device.runInstallNativeApp('Boom Town', 'applab.boomtown://', 'market://details?id=com.intel.xdk.applab.boomtown', 'com.intel.xdk.applab.boomtown');
Running or Installing iOS app
//Parameters: app name, protocol handler, app location
intel.xdk.device.runInstallNativeApp('Old Lady Puzzle', 'oldemo.puzzle://', 'itms-apps://itunes.apple.com/us/app/old-lady-puzzle/id525537202?mt=8');
intel.xdk.device.runInstallNativeApp('Old Lady Puzzle', 'oldemo.puzzle://', 'itms-apps://itunes.apple.com/us/app/old-lady-puzzle/id525537202?mt=8');
If app is not already installed then the above code installs and runs the app. If its already installed then it just runs the app.
This function only works inside event handlers. So you can’t just call it whenever you like to. For example:
document.addEventListener("intel.xdk.device.ready",function(){
intel.xdk.device.runInstallNativeApp('Old Lady Puzzle', 'oldemo.puzzle://', 'itms-apps://itunes.apple.com/us/app/old-lady-puzzle/id525537202?mt=8');
},false);
intel.xdk.device.runInstallNativeApp('Old Lady Puzzle', 'oldemo.puzzle://', 'itms-apps://itunes.apple.com/us/app/old-lady-puzzle/id525537202?mt=8');
},false);
Make sure you have also added Intel XDK Device plugin in your app.
Leave a Reply