I'm using sencha version 2.1.1 ,sencha cmd version v3.0.2.288. Ext.device.Device.openURL
is not working. what can I do here? forums says that upgrading sencha will fix it, is it true? then How can I upgrade it?
1
votes
1 Answers
0
votes
When certain button tap URLs would not open through either mobile security, or cases above where functionality is solely native, I use this snippet:
MyApp.Util.openLink = function(href) {
var link = document.createElement('a');
link.setAttribute('href', href);
link.setAttribute('target','_blank');
var clickevent = document.createEvent('Event');
clickevent.initEvent('click', true, false);
link.dispatchEvent(clickevent);
return false;
};
I have utility functions extended off the app namespace, when required. To emulate Ext.device.Device.openURL, you can set the old window to close in your code after MyApp.Util.openLink(href);
is called.
This currently only works on iOS using the Sencha Native Packager. Attempting to use this on PhoneGap, iOS Simulator or the browser will simply result in the current window location changing.
If you are using phonegap then you can usenavigator.app.loadUrl()
method. – SachinGuttesencha app build native
– Harikrishnan