Announcement

Collapse
No announcement yet.

How to Alert and Redirect users to Mobile App

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    I can't use this, it asks every time a new window is open. This should be put in a cookie and should only pop up once like tapatalk.

    Comment


    • #17
      Originally posted by MikesSite View Post
      I can't use this, it asks every time a new window is open. This should be put in a cookie and should only pop up once like tapatalk.
      I agree that a one time pop up, or allowing the user to select to not display the pop up in the future would be optimal.

      However, if you don't reload the full forum all the time (by using the back button, for example) the notification doesn't pop up for me and I find it ok.

      Comment


      • #18
        Great! It is exactly what I was looking for

        Great job!

        Dan

        Comment


        • #19
          This adds a cookie so it only pops up once per session:

          Header:

          Code:
          <body onload="loadornot();">
          Headinclude:

          Code:
          <script type="text/javascript">
          
          function get_cookie(Name) {
            var search = Name + "="
            var returnvalue = "";
            if (document.cookie.length > 0) {
              offset = document.cookie.indexOf(search)
              if (offset != -1) { // if cookie exists
                offset += search.length
                // set index of beginning of value
                end = document.cookie.indexOf(";", offset);
                // set index of end of cookie value
                if (end == -1)
                   end = document.cookie.length;
                returnvalue=unescape(document.cookie.substring(offset, end))
                }
             }
            return returnvalue;
          }
          
          function loadornot()
          {
          if (get_cookie('popup')=='')
          {
          iPhoneAlert( )
          document.cookie="popup=yes"
          }
          }
          
          
          
          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 ________ for iPhone." );
          if ( qes )
          window.location   = "http://________";
          }
          else if ( navigator.userAgent.match(/Android/i) )
          {
          var qes   = confirm( "This forum has an Android app! Click OK to learn more about ________ for Android." );
          if ( qes )
          window.location   = "https://_______";
          }
          }
          </script>

          Comment


          • #20
            Thanks for the cookie.

            Comment


            • #21
              Originally posted by SteveLV702 View Post

              ***UPDATED July 7, 2012*** With the future release of iOS 6 this Fall you can add "SmartApp Banners" to your site example running on my sites below.

              [ATTACH=CONFIG]60408[/ATTACH][ATTACH=CONFIG]60409[/ATTACH][ATTACH=CONFIG]60410[/ATTACH][ATTACH=CONFIG]60411[/ATTACH][ATTACH=CONFIG]60412[/ATTACH]

              To acquire this on your site just add one simple line of code I added it to the very very top of the headerinclude template

              <meta name="apple-itunes-app" content="app-id=XXXXXXXX">

              Replace the XXXXXXXXX with your apps actual App ID.
              I did this and it works great! Thanks. I will try the other one later.

              - - - Updated - - -

              Originally posted by af1racing View Post
              This adds a cookie so it only pops up once per session:

              Header:

              Code:
              <body onload="loadornot();">
              Headinclude:

              Code:
              <script type="text/javascript">
              
              function get_cookie(Name) {
                var search = Name + "="
                var returnvalue = "";
                if (document.cookie.length > 0) {
                  offset = document.cookie.indexOf(search)
                  if (offset != -1) { // if cookie exists
                    offset += search.length
                    // set index of beginning of value
                    end = document.cookie.indexOf(";", offset);
                    // set index of end of cookie value
                    if (end == -1)
                       end = document.cookie.length;
                    returnvalue=unescape(document.cookie.substring(offset, end))
                    }
                 }
                return returnvalue;
              }
              
              function loadornot()
              {
              if (get_cookie('popup')=='')
              {
              iPhoneAlert( )
              document.cookie="popup=yes"
              }
              }
              
              
              
              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 ________ for iPhone." );
              if ( qes )
              window.location   = "http://________";
              }
              else if ( navigator.userAgent.match(/Android/i) )
              {
              var qes   = confirm( "This forum has an Android app! Click OK to learn more about ________ for Android." );
              if ( qes )
              window.location   = "https://_______";
              }
              }
              </script>
              Works!

              Comment


              • #22
                In iOS 6, if I use both java-script and meta tag, will it show 2 duplicate bar?
                We need use both for iOS 6 and previous iOS ver. Right?

                - - - Updated - - -

                Anyone have screenshot of this script?

                Comment


                • #23
                  Hi. What would be the code if I want to show a pop-up only to Android users?

                  Thanks!

                  Comment


                  • #24
                    I cant find headinclude template on my vB 5 ..

                    Comment


                    • #25
                      Originally posted by Merenguista View Post
                      I cant find headinclude template on my vB 5 ..
                      I think this code is just for 4.X, not sure Steve has done anything for VB5

                      Comment


                      • Merenguista
                        Merenguista commented
                        Editing a comment
                        Thanks .. Alas !

                    • #26
                      Does anyone use something like this for vb5? Or knows how to implement it there? Thanks!

                      L.E. it works for me in vb5... the headerinclude template is header-include in vb5. Have manage to see it work on android...
                      Last edited by Cristi_XP; Thu 31st Oct '19, 5:37am.

                      Comment


                      • #27
                        This thread is nearly nine years old. A *lot* has changed in that time, so it would be better to start a new thread with full details of the issue.
                        MARK.B | vBULLETIN SUPPORT

                        TalkNewsUK - My vBulletin 5.5.6 Demo
                        AdminAmmo - My Cloud Demo

                        Comment


                        • #28
                          Yes, but it works also in vb5 also, so I confirmed to anyone want to use this.

                          Comment

                          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                          Working...
                          X