0
Welcome Guest! Login
0 items Join Now

SOLVED Detect User Agent then Pop-up for mobiles

  • SOLVED Detect User Agent then Pop-up for mobiles

    Posted 12 years 1 month ago
    • Hi, I'm thinking for older templates, to be able to :

      1. detect user agent (iphone, ipad, android etc)
      2. if user agent is a mobile device, then create a Pop-up message, suggesting they download the App instead of browsing the site.

      I've found a post on detecting User Agents, some PHP (which only seems to work for iphone, not Android very well), but then the issue is how to throw up a pop-up message after a positive detection.

      Any ideas.
    • Last Edit: 12 years 1 month ago by Lakes Entrance.
    • Who?'s Avatar
    • Who?
    • Preeminent Rocketeer
    • Posts: 25562
    • Thanks: 613
    • Joomla freelancer

    Re: SOLVED Detect User Agent then Pop-up for mobiles

    Posted 12 years 1 month ago
    • Why don't you just show article with the same content as popup message box?
    • Check my services at: Mihha-Vision
  • Re: SOLVED Detect User Agent then Pop-up for mobiles

    Posted 12 years 1 month ago
    • that was an option. But the convenience for the user, of just clicking "no" to get rid of the message and be on the home page instantly, as opposed to then having to click another link to get back to the home page.

      i'm looking into media queries to do the detection, but have no idea how to instigate rokbox or something similar inside that sort of code. out of depth here really, without further assistance and/or research.
  • Re: SOLVED Detect User Agent then Pop-up for mobiles

    Posted 12 years 1 month ago
    • Solved it for now, just using two user agents, and this code wrapped in script tags in the header.
      if(navigator.userAgent.toLowerCase().indexOf("android") > -1) {
           if(confirm("Download app?")) {
                window.location.href= "market://details?id=com.mythiksoftware.lakesentrance";
           }
       
      }

      and the other one has "iphone" instead of android.

Time to create page: 0.151 seconds