0

I am using Cubic to implement 'Add to home' functionality. What I want to know is how can I detect if my application is launched from the icon created by 'add to home' or from any browser.

I want this check basically on iPad. Usually there are 3 ways my users access my app on iPad:

  1. Shortcut on home (created by add to home)
  2. Google Chrome
  3. Safari

I could detect the 2nd and 3rd. But I couldn't detect the 1st one.

This is how I check if the user is using iPad:

var isiPad = navigator.userAgent.match(/iPad/i) != null;
if(isiPad){
  /* do something */
}

This is how I check if the user is using Google Chrome on iPad:

if(navigator.userAgent.match('CriOS')){
  /* do something */
}

Thanks in advance for any help.

3
  • if you know how to detect 2nd and 3nd. So when it is not the 2nd & 3rd case then it will from 'Add to Home' button. Commented Jun 19, 2014 at 7:14
  • @BhushanKawadkar but if it is not 2nd and 3rd it can be any other browser from desktop too. I am looking for iPad basically. Commented Jun 19, 2014 at 7:19
  • Please share some code what have you tried. Commented Jun 19, 2014 at 7:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.