1
votes

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
according to docs of both 2.1 and 2.2 - 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 use navigator.app.loadUrl() method.SachinGutte
tried in iOSSimulator..not workingHarikrishnan
are you using Sencha Native Packager ? if yes then i've to say it's buggy. Or perhaps try it on real device with packaged app using Sencha Native Packager.SachinGutte
I'm using this command sencha app build nativeHarikrishnan

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.