Open URL in new window in IOS app

Open URL in new window in IOS app

  

When the user taps on an external link in my mobile app, the URL opens in the current window. In android, you can tap on the back button and go back to my app, but in IOS there is no way to get back to the app. I tried this, but it does not seem to work.

In the properties of the link, I used:

  • Property: target
  • Value: "_blank"


Any ideas? Thanks,

Gonzalo

Solution

Hi Gonzalo,

You can put "external:" in front of the url to open the url in the platform default browser.

For example you want to open "https://www.google.com" in Safari

The url will be "external:https://www.google.com"

Kind regards,

Remco Dekkinga

Solution

Thanks Remco,


It worked perfectly for Android, but I get a "There was an error processing your request" error in IOS. Any suggestions?

Gonzalo


Strange, I just tried it on my phone (apple) before I sent the solution. It worked like a charm.

Can you try to republish the app or reinstall on your iPhone to see if this solves the issue?

If this doesn't solve the issue, can you try to see for error details in the error log?

I tried republishing and re-installing, but no luck. I don't have an iPhone to test the app, so I am using an iPod touch. Would that make a difference? I believe the OS is the same.

I tested in an iPhone and does not work correctly either.

Also, When I use "External", it does  not work on the browser emulator either. This is the link to the app in Itunes. https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1252295402&mt=8

Hi Gonzalo,

Try to add value "_system" instead of "_blank". I've had the same problem ones in an other Phonegap project.
I hope this works out for you!

Regards,
Jasper

Thanks Jasper

I tried "-system" with and without "external:" in front of the URL. It works perfect for android, but it does not for iPhone. It seems to crash

Gonzalo

Hmm....supposed to be working. You sure you used "_system" (with underscore).

Yeah. You want me to select enter "Target" as Property and "_system" as Value, right? as the picture below?

I tried again, just in case. No luck. iPhone does not work. Android...Perfect


Yes, but that doesn't work?
I'm afraid iOS doesn't support this anymore, your only option is then to add an inAppBrowser:
https://www.outsystems.com/forums/discussion/18203/open-link-in-system-browser-from-outsystemsnow-application/
Hope this helps!

Jasper, I am sorry but I am new to this platform and don't know how to implement this plugin. Do you have any link I can read to learn how to?


You can install the InAppBrowser plugin from the Forge store within OutSystems Studio:
https://www.outsystems.com/forge/component/1558/inappbrowser-plugin/

It's supported and published by OutSystems. For installation guides etc. read this topic:
http://www.outsystems.com/forums/discussion/22961/using-forge-components/

Thanks for all your help


I tried creating a button and assigning a client action to the click event..


Then, I defined the client action as this

In the plugin action I set it like this:


the button does nothing....

Thanks Remco,


It worked perfectly for Android, but I get a "There was an error processing your request" error in IOS. Any suggestions?

Gonzalo,

I'm afraid that the problem with iOS is with your device. Can you share what the model of your iPod is and which version of iOS?

Kind regards,

Remco Dekkinga

Remco, 

I sincerely appreciate your help.

I am using an Ipod Touch with IOS 10.3.2. I also tried an Iphone 6 and have the same problem. If I just use the link property to "redirect to URL", the page opens in the apparenmtly as part of the application, but you just cannot go back to my screens and the user has to shut the app down and re-start. 

If i use the prefix "external:" in front of the URL, the app crashes in IOS.

I tried using the InAppBrowser plugin as shown in my pictures above, but the enabled button does nothing on either android or IOS




Gonzalo,

I'm using that plugin for a scenario exactly like yours and it works well. Have you generated a new build of your application and installed it on the devices you are using to test? Nothing happening when you click the button sounds like what would happen if the installed application didn't include the InAppBrowser plugin.

Gonzalo,

Seems there is a glitch in the native shell that causes the problem you're reporting. This will be fixed and move to production during this week. 

Thanks for reporting!
R

Gonzalo Labarca wrote:

Remco, 

I sincerely appreciate your help.

I am using an Ipod Touch with IOS 10.3.2. I also tried an Iphone 6 and have the same problem. If I just use the link property to "redirect to URL", the page opens in the apparenmtly as part of the application, but you just cannot go back to my screens and the user has to shut the app down and re-start. 

If i use the prefix "external:" in front of the URL, the app crashes in IOS.

I tried using the InAppBrowser plugin as shown in my pictures above, but the enabled button does nothing on either android or IOS






Hi Rodrigo,

Nice to read the good news.

In the latest release (https://success.outsystems.com/Documentation/10/Release_Notes/Development_Environment_10.0.611.0), I don't see a mention about it yet.

Which of the three problems will be resolved in the upcoming version? (1. Redirect to URL property, 2. crash in iOS for 'external:', or 3. InAppBrowser plugin which does nothing).

We encounter problem 2 as well.

Rodrigo Coutinho wrote:

Gonzalo,

Seems there is a glitch in the native shell that causes the problem you're reporting. This will be fixed and move to production during this week. 

Gonzalo Labarca wrote:

Remco, 

I am using an Ipod Touch with IOS 10.3.2. I also tried an Iphone 6 and have the same problem. If I just use the link property to "redirect to URL", the page opens in the apparenmtly as part of the application, but you just cannot go back to my screens and the user has to shut the app down and re-start. 

If i use the prefix "external:" in front of the URL, the app crashes in IOS.

I tried using the InAppBrowser plugin as shown in my pictures above, but the enabled button does nothing on either android or IOS

Update:

After the upgrade it seems to go well on iOS and Android.

We translate our links to: <a href="external:https://..">