Hide Safari address bar on iOS 5

2019-03-04 13:00发布

问题:

I'm building a booking app for my shop that will be displayed in an enclosed case for my customers to use. As the app will be accepting payments I will need to launch Safari to process the payment through my website to avoid Apple's sale costs.

When I launch the payment site via

[[UIApplication sharedApplication] openURL:url];

is it possible to hide Safari's address bar?

The reason being I don't want my customers using the iPad to search the Internet (I plan on putting a cover over the home button so they can't press it).

I've had a look around as none of the proposed JavaScript or meta tag solutions seem to work.

回答1:

Embed a UIWebView into your app and then you will have the features of Safari without your address bar problem.

As for Apple not liking your app's users purchasing stuff without going through Apple's in-app payment process, it depends on what you're selling. If it's enhanced functionality for the app or digital content, they definitely would be annoyed (and if they thought you were trying to do an end-run around this via the Safari thing, they would likely reject your app). If your app is simply a gateway to some brick & mortar store (that sells physical things), Apple doesn't care if you go to the site with a UIWebView.



标签: ios safari