问题
is this possible somehow?
I would like to redirect to different pages depending on whether the user already installed an app or not.
回答1:
It is completely impossible for your server to reliably tell whether an app is installed on the client.
(Unless you can associate app users with page viewers by user account)
回答2:
Not really possible. You can launch the app using the custom URL scheme but the user will get a Safari error dialog if the app isn't installed.
I guess your app could ping the server with some unique session ID when it launched and you could send this back to the web page using Ajax as a success validation.. Seems like a lot of work and pretty fragile.
It may be possible to detect the safari error dialog with some clever JavaScript?
回答3:
This would be a pretty significant privacy violation. A phishing site, for example, could determine which banks I use by looking for their iPhone apps on my phone. Apple's not going to permit that, let alone make the data available deliberately.
来源:https://stackoverflow.com/questions/4180272/detect-installed-iphone-app-using-php