Question

I am developing a CAPTCHA app for iOS which can be used on websites as an alternative to CAPTCHA codes like reCAPTCHA. I have a button which uses a custom URL Schema to launch the app. The user then proves that they are a human and now I want to return the user to the page they were on.

I have tried opening the browser using the URL they came. This opens the same tab that the user came from but then refreshes the page. Any data that the user entered into a form before clicking the button is seen for a split second before the page refreshes and all the data is lost!

Apple do not allow apps on the app store that close themselves so I cant simply exit.

How can I return the user to the page in the browser that launched my app without refreshing the page so that no form data is lost?

Thanks in advance for any help.

Was it helpful?

Solution

I finally work out a way to do this. If you append #anything to the URL of a page that is already open in Safari, it simply returns to that page without reloading it!

This makes sense although there are a few anomalies. If there is an anchor on the page matching the #anything, it doesn't jump to that point in the page as it would if a link with the anchor was clicked. Also, if there is already a page open exactly matching the URL including #anything, the page is reloaded.

So my solution it so to call the original URL with a #random anchor appended to it.

OTHER TIPS

Is interested question, I have no idea how to do this on iOS side, because I don't know way to open browser without re/opening some URL, but is possible to do with help on web side.

Before launching your app is possible to save form data, assign it to some key and send to you with URL, after all done you will return to page with key in params and data will be restored by this key.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top