Page 3 of 4

Auto Rotate stopped working and app fails to return to main screen after hot link clicked

Posted: Thu Aug 29, 2013 11:59 pm
by mikeflores2000

Well, I've always been able to either exit browser or return to my app.
-Good Luck.


Auto Rotate stopped working and app fails to return to main screen after hot link clicked

Posted: Fri Aug 30, 2013 11:41 am
by Maryna Brodina

Hi, yes you were right. Our developers already looking into this issue.


Auto Rotate stopped working and app fails to return to main screen after hot link clicked

Posted: Thu Sep 19, 2013 5:06 am
by mikeflores2000

Hi Marina,

Any update from your developers?

Thanks,
Mike


Auto Rotate stopped working and app fails to return to main screen after hot link clicked

Posted: Thu Sep 19, 2013 9:03 am
by Kateryna Grynko

Hi Mike,

Sorry, no update. Developers are working on it, but no ETA yet.


Auto Rotate stopped working and app fails to return to main screen after hot link clicked

Posted: Thu Sep 19, 2013 12:19 pm
by Kateryna Grynko

Hi Mike,

After deep investigations we have found the following:

In your app you use a transformation for the label element where links (and whole messages) are displayed after searching. This transformation finds links in messages and changes them in way when parameter target="_blank" is added to the < a tag. It is supposed, that when this link is tapped it opens in Mobile Safari instead of UIWebView.

Attached project's assets can reveal that version of Cordova is 2.4.0 (appery lib 1.0). It seems that starting from Cordova 2.3 there is other mechanics to open links. Parameter "target" is not supported. But you still can open links not in WebView but either in Safari or InAppBrowser. To do this you should perform the following:

  1. Enable support of InAppBrowser: Open config.xml on the Editor's tab "Sources" and add the following line to the :
    code<plugin name="InAppBrowser" value="CDVInAppBrowser" &#47;>/code

  2. Update transformation for component with ID = messageLabel with the following text: codeHere should be the code you can see in the next comment&#46; GetSatisfaction doesn't display it correctly/code

  3. The code in point 2 opens links in the InAppBrowser. If it is necessary to open in Safari, then _blank should be replaced with _system.

  4. This solution is actual only for iOS. It wasn't tested on Android and WinPhone apps so I cannot guarantee it does not break other components.


Auto Rotate stopped working and app fails to return to main screen after hot link clicked

Posted: Thu Sep 19, 2013 12:22 pm
by Kateryna Grynko

var inputText = value;

var replaceText, replacePattern1, replacePattern2, replacePattern3;

//URLs starting with a href="http://" rel="nofollow"http:///a, a href="https://" rel="nofollow"https:///a, or ftp://
replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~|!:,.;]*[-A-Z0-9+&@#\/%=~|])/gim;
replacedText = inputText.replace(replacePattern1, '[url=http://#]$1[/url]');

//URLs starting with "www." (without // before it, or it'd re-link the ones done above).
replacePattern2 = /(^|[\/])(www\.[\S]+(\b|$))/gim;
replacedText = replacedText.replace(replacePattern2, '$1[url=http://#]$2[/url]');

//Change email addresses to mailto:: links.
replacePattern3 = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim;
replacedText = replacedText.replace(replacePattern3, 'a href="mailto:$1" rel="nofollow"$1/a');

return replacedText;


Auto Rotate stopped working and app fails to return to main screen after hot link clicked

Posted: Thu Sep 19, 2013 12:29 pm
by Kateryna Grynko

The main problem was that the version of Cordova 2.4 works a bit differently than assumed in the code. Indeed, in version 1.6, for example, everything worked. Although you did not change the code, Appery.io lib renewed, Cordoba was updated to 2.4, and all stopped working.


Auto Rotate stopped working and app fails to return to main screen after hot link clicked

Posted: Thu Sep 19, 2013 5:46 pm
by mikeflores2000

widget
plugin name="InAppBrowser" value="CDVInAppBrowser"
Did not work. Should this not point to Safari instead of InAppBrowser?

Also your code is missing _blank so how can I change to _system?
In addition it also did not fix problem:
var inputText = value;

var replaceText, replacePattern1, replacePattern2, replacePattern3;

//URLs starting with a href="http://" rel="nofollow"http:///a, a href="https://" rel="nofollow"https:///a, or ftp://
replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~|!:,.;]*[-A-Z0-9+&@#\/%=~|])/gim;
replacedText = inputText.replace(replacePattern1, '$1');

//URLs starting with "www." (without // before it, or it'd re-link the ones done above).
replacePattern2 = /(^|[\/])(www\.[\S]+(\b|$))/gim;
replacedText = replacedText.replace(replacePattern2, '$1$2');

//Change email addresses to mailto:: links.
replacePattern3 = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim;
replacedText = replacedText.replace(replacePattern3, '$1');

return replacedText;


Auto Rotate stopped working and app fails to return to main screen after hot link clicked

Posted: Thu Sep 19, 2013 7:13 pm
by Maryna Brodina

Hello! We'll take a look again. Sorry for delay.


Auto Rotate stopped working and app fails to return to main screen after hot link clicked

Posted: Fri Sep 20, 2013 4:19 am
by mikeflores2000

I will email support for the code due to format issues here.