I send emails to my iOS customers with links to our app. When they tap the link, I want to check if they have the app installed.
If the app is installed I want to open it. If not it will redirect to download the app in the App Store.
The URL I'm using to open the app is:
rva://store?uuid=EFBBD9FF-3976-4816-8B77-C1462C99E256
And the check I was using is:
def responds_to_url?(url)
response = Net::HTTP.get_response(URI(url)).code
if response == "200"
return true
else
false
end
end
The problem is that passing my URL above to URI() returns a Generic (capital G) URI object, whereas it should (if it were http) return an HTTP object.
How can I do a similar check with just a link (i.e. no javascript)?
I thought about passing the URL to Mobile Safari and seeing if it responds, but I don't know how to do that or even if it's possible.