iPhone check

by Paweł Niemczyk

HTML

<iframe id="checker" src="" style="display:none">
</iframe>

<div id="loader">
Please wait ...
</div>

<div id="app-present" style="display:none">
	App was finded and frendship confirmation will be confirm via fetchstr app
</div>

<div id="app-missing" style="display:none">
 We do not detect app on your iphone so you need to install the app and get back to this page
 <a href="#"> Download app from appstore</a>
 
 <button>
 I have installed app
 </button>
 
 <button>
 	I preffer to fill the form
 </button>
</div>

CoffeeScript

initState = true
appUri = "fetchstr://?token=123";
$("#checker").on('load', ->
  if initState == true
    $('#loader').hide()
    $('#app-present').show()
		initState = false
)

$("#checker").attr("src", appUri);

showFormIfAppMissing = ->
  if initState == true
    $('#loader').hide()
    $('#app-missing').show()
		initState = false

setTimeout showFormIfAppMissing, 3000