• Resolved arnygood

    (@arnygood)


    Hi,
    I’m trying to setup a “fake” URL to redirect users on Google Play or the App Store depending on their device.
    I’ve created 2 rules:

    1. For unexistingpage.com, go to googleplay.url if user agent is Android (regex), else go to existingpage.com
    2. For unexistingpage.com, go to appstore.url if user agent is iPhone (regex), else go to existingpage.com

    It works like a charm for Android but not for iPhones. I can’t find any answer on the internet!

    Any help guys?
    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author John Godley

    (@johnny5)

    You need to ensure that the user agent matches the regex you’ve set. Also, you may run into issues with caches (both on your site and in the browser).

    Thread Starter arnygood

    (@arnygood)

    Hi John, thanks for your quick reply. What do you mean by “ensure that the user agent matches the regex”? I’ve put “iPhone” in the user agent field + clicked the regex tick (like I did for Android). And then I asked iPhone users to click on the link but they are redirected to the “else page”, not the App Store.

    I’m not using any cache plugin by the way.

    Plugin Author John Godley

    (@johnny5)

    Putting iPhone in the field and clicking regex does not sound like it will match. Likewise for Android, although it may accidentally do what you want in particular circumnstances.

    You need to put a regular expression there that matches the full user agent passed by an iPhone.

    The redirect will work once the user agent matches.

    Thread Starter arnygood

    (@arnygood)

    Hi John, I can’t make it work… Any idea how to do it? Thanks ??

    Plugin Author John Godley

    (@johnny5)

    Can you provide a full URL and a screenshot of your redirect settings? An iphone user agent match works fine for me.

    Thread Starter arnygood

    (@arnygood)

    Hi! The URL is: https://myclim8.com/app-download
    Here is the screenshot of the setup: https://ibb.co/PmhywTk
    It works very well for Android but not iOS.
    Thanks!

    Thread Starter arnygood

    (@arnygood)

    Hello, I found a solution. Actually, it works well when putting “iPhone” in the matching field. I just had two rules being in conflict.

    What I did to solve the issue:

    1. Created two rules: one matching “iPhone” redirecting to the App Store, the other one matching “Android” and redirecting to Google Play.
    2. Left blank in the “Else” field for the iPhone rule
    3. I’ve put an URL in the “Else” field for the Android rule
    4. Put the iPhone rule as Position 1 and the Android rule as Position 2

    This way, the website checks if phone is iPhone.
    If Yes, redirects to App Store.
    If No, checks if phone is Android.
    If Yes, redirects to Google Play.
    If No, redirects to some web page.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘iPhone user agent not working’ is closed to new replies.