Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening apps and closing Safari tabs on iOS

We have an App that accepts donations and per Apple's guidelines (item 21.2) we can't do this in-app, it must open a webpage in Safari to perform the donation. We've got that bit working fine, and we can actually automatically invoke the App post donation and put the user right back where they left off. The trouble is that the Tab in Safari persists when the user returns to Safari later.

Is there a way to open an app from a webpage while simultaneously closing said webpage in Safari?

like image 761
MyItchyChin Avatar asked Jun 10 '14 17:06

MyItchyChin


People also ask

Why do my Safari tabs keep closing on iPhone?

Safari automatically closes your opened tabs after a specific period if you have particular settings saved. This may be another reason if your tabs seem to disappear after a certain duration. To make sure it doesn't happen again, set the Close Tabs for Safari to Manually, and you're set to go.

How do I make Safari automatically close tabs?

How to Automatically Close Safari Tabs. Navigate to Settings –> Safari, then open "Closed Tabs" from the Tabs grouping. By default, it's set to manual, but you can set it to auto-close tabs that haven't been viewed recently. You can pick to auto-close tabs after one day, one week, or one month.

How do I see all open tabs on my iPhone?

To access your tabs on an iPhone if the address bar is at the top, tap the Tabs icon in the lower right. Your open tabs appear as thumbnails.


1 Answers

So apparently the way to do it is via Javascript. You can set the window location and then immediately close the window.

e.g.

window.location = "myapp://?stuff";
window.close;
like image 175
MyItchyChin Avatar answered Nov 03 '22 00:11

MyItchyChin