Created
May 13, 2014 03:23
-
-
Save elidupuis/f966e5cec7b6443f88d2 to your computer and use it in GitHub Desktop.
Simple Cordova WebIntent test function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://github.com/InQBarna/WebIntent | |
| function testIntent () { | |
| console.log('testIntent...'); | |
| if (window.device) { | |
| console.log('DEVICE mode; testing web intent: startActivity'); | |
| var address = 'edmonton alberta'; | |
| CDV.WEBINTENT.startActivity({ | |
| action: CDV.WEBINTENT.ACTION_VIEW, | |
| // url: 'geo:0,0?q=' + address | |
| url: 'http://fzs.sve-mo.ba/sites/default/files/dokumenti-vijesti/sample.pdf' | |
| }, | |
| function() {}, | |
| function() { | |
| console.log('Failed to open URL via Android Intent') | |
| } | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment