How to Alert and Redirect users to Mobile App

Collapse
X
Collapse
  •  

  • How to Alert and Redirect users to Mobile App

    Here are instructions on how to display an alert on your users phone when they attempt to browse your site from their phones browser.

    open up the "header" template and at the very bottom add this code:

    Code:
    <body onload="iPhoneAlert( );">
    then open up "headinclude" template and at the very bottom add this code:

    Code:
    <script type="text/javascript">
    function iPhoneAlert( )
    {
    if ( navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) )
    {
    var qes* *= confirm( "This forum has an iPhone app! Click OK to learn more about Digital Mayhem Mobile for iPhone." );
    if ( qes )
    window.location* *= "http://dmlinks.us/DMMobile-iOS";
    }
    else if ( navigator.userAgent.match(/Android/i) )
    {
    var qes* *= confirm( "This forum has an Android app! Click OK to learn more about Digital Mayhem Mobile for Android." );
    if ( qes )
    window.location* *= "market://details?id=com.vbulletin.build_113";
    }
    }
    </script>
    of course replacing Digital Mayhem Mobile with the name of your App and the links with the links of your App Store and Android Market links...


    **NOTE** I am trying to find a better file to put the code that loads first because atleast on all of my sites from both iPhone & Android practically the entire site loads before the message is displayed and user redirected.

    **Maybe vBulletin will make this a sticky**
    Last edited by Wayne Luke; Thu 11 Nov '21, 2:00pm.

    • dillon015
      #4
      dillon015 commented
      Editing a comment
      thank you for sharing

    • nima6
      #5
      nima6 commented
      Editing a comment
      I don't have an iPhone app yet but I do have an Android one. I put the code in header and the following in headerinclude but its not working. Any idea why? Here is a link to the forum.

      Code:
      <script type="text/javascript">
      function iPhoneAlert( )
      {
      if ( navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) )
      {
      var qes* *= confirm( "This forum has an iPhone app! Click OK to learn more about Hookah Forum mobile app for iPhone." );
      if ( qes )
      window.location* *= "";
      }
      else if ( navigator.userAgent.match(/Android/i) )
      {
      var qes* *= confirm( "This forum has an Android app! Click OK to learn more about Hookah Forum mobile app for Android." );
      if ( qes )
      window.location* *= "market://details?id=com.vbulletin.build_1221";
      }
      }
      </script>

    • screenmates
      #6
      screenmates commented
      Editing a comment
      Why don't they include this chunk in the vB's core instead?

      Another nice feature is to include Suppress-o-Matic code to suppress repetitive email alerts on dB failure. These are a few lines of code that would prevent hacking our code.
    Posting comments is disabled.

About the Author

Collapse

SteveLV702 Find out more about SteveLV702

Article Tags

Collapse

administration (1) beginner (3) calendar (1) cloud (1) Custom (1) database (2) Google (1) how-to (2) howto (1) how to (1) https (1) Intermediate (4) MYSQL (2) performance (2) recovery tools (1) security (2) seo (1) server information (1) sftp (1) ssl (1) style (1) tls (1) tutorial (4) vb5howto (5) vbcloud (1)

Latest Articles

Collapse

  • Enabling Push Notifications in vBulletin 5.3.2 and Mobile Suite 1.16
    by Wayne Luke
    vBulletin Mobile Suite 1.16 includes functionality for Push Notifications. One of the requirements to add this functionality is that you must be running vBulletin 5.3.2 Connect on your site and create a project with Google's Firebase Cloud Messaging (FCM) platform. The steps below will walk you through the process of enabling this functionality in vBulletin and in your Mobile Apps.

    Add a project to your Firebase account








    ...
    Thu 27 Jul '17, 8:56am
  • How to Alert and Redirect users to Mobile App
    by SteveLV702
    Here are instructions on how to display an alert on your users phone when they attempt to browse your site from their phones browser.

    open up the "header" template and at the very bottom add this code:

    Code:
    <body onload="iPhoneAlert( );">
    then open up "headinclude" template and at the very bottom add this code:

    Code:
    <script type="text/javascript">
    function iPhoneAlert( )
    {
    if ( navigator.userAgent.match(/iPhone/i)
    ...
    Mon 16 May '11, 12:01pm
  • Install App in Android Emulator
    by Jasper Aguila
    Don't have an Android device and want to see your vBulletin Mobile Suite app before it gets published? Then use the Android Emulator!

    Below is a tutorial on how to run your apk file in the Android emulator. Note: Extra step for Windows 7/Vista users! All the way at bottom of the post!

    For Mac Users check the second comment made by Lynne below.

    Thank you so much to botskool for basically helping me compile this article!
    ----------------------------------------------------------------------- ...
    Fri 13 May '11, 1:52pm
  • Installing Your App on your iPhone
    by SteveLV702
    So you got the new Mobile Suite, compiled your App and submitted to Apple but don't wanna wait for Apple to Approve it and get in the store which can take like 6 weeks... You wanna use your app NOW... well you can here is the instructions... * Login to your iOS Provisioning Portal > Devices > Add Device > enter your Phones UID to get your phones UID connect to iTunes in the Phone Summery page click on serial number and while change to UID. * go to Provisioning > Distribution tab > N...
    Fri 22 Apr '11, 12:23pm
  • Recovering App Crash Reports
    by Wayne Luke
    In order to help diagnose bugs and error reports it would be very helpful if you submitted the bug and crash reports generated by the apps in your JIRA issue report. These crash reports will be located within your Apple App Store or Android Marketplace developer's sites. Below, we have outlined the steps to recover these. Once recovered, you will need to either copy and paste them into the JIRA issue report as a comment or attach the resulting file to the JIRA Issue Report.

    iOS Issue...
    Mon 18 Apr '11, 9:06am
  • 12. Create an Android Application
    by Wayne Luke
    This article tells you how to create your Android Application. This is the second step in getting your vBulletin App submitted to Google for Approval. ...
    Wed 13 Apr '11, 9:06am
Working...