App Banners for Android (smartbanner.js)

user1173169 picture user1173169 · May 21, 2014 · Viewed 8.8k times · Source

in an empty HTML page,i try to display a banner including the link of my app

I used this as tutorial: http://www.dunnsolutions.com/content/application-development-blog/-/blogs/smart-app-banners-for-ios-and-android

For the moment, i just try to make it work locally, in an empty page. This is my page:

<html>
  <head>
    <title>Hulu Plus</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="author" content="Hulu LLC">
    <meta name="google-play-app" content="app-id=MyAppIdIsHere">
    <link rel="stylesheet" href="jquery.smartbanner.css" type="text/css" media="screen">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
    <script src="jquery.smartbanner.js"></script>
    <script type="text/javascript">
        $(function () {
        $.smartbanner({
          title: 'Audience Opinion',
          author: 'Dunn Solutions Group'
        });
        })
    </script>
  </head>
  <body>
  </body>
</html>

My html page and the js/css files are located in the same folder. there is no problem of path.

Does anyone know why this code does not work ? Thanks in advance!

Answer

dMcNavish picture dMcNavish · Sep 4, 2014

The default option is to only display the bar on a either an Android or iOS device. If you open the page on a desktop, nothing appears. You can set the 'force' option to 'windows' in order to have it appear on your desktop.

$(function () { $.smartbanner({ daysHidden: 0, daysReminder: 0, title:'Hulu', force:'windows' }) })

All of the other options can be found on the github page: https://github.com/jasny/jquery.smartbanner