Top Nav Bar Demo App

iOS

Android

/* Dynamic Title Configuration */
[
  {
    "regex": "https://gonativeio.github.io/gonative-demos/advanced-navigation-demo.html",
    "title": "Home"
  },
  {
    "regex": "https://gonativeio.github.io/gonative-demos/contact.html",
    "title": "Contact Us"
  },
  {
    "regex": "https://gonativeio.github.io/gonative-demos/about.html",
    "title": "About"
  }
]
/* Set Dynamic Title */
var json = JSON.stringify({
  active: true,
  titles: [{
    title: 'Example Title #1',
    regex: 'https://gonativeio.github.io/gonative-demos/advanced-navigation-demo.html'
  },
  { 
    title: 'Example Title #2',
    regex: 'https://gonativeio.github.io/gonative-demos/contact.html'
  },
  { 
    title: 'Example Title #3',
    regex: 'https://gonativeio.github.io/gonative-demos/about.html'
  }]
});

window.location.href = 'gonative://navigationTitles/set?persist=true&data=' + encodeURIComponent(json);
/* Set Current Page Title */
if (navigator.userAgent.indexOf('gonative') > -1) {
  window.location.href = 'gonative://navigationTitles/setCurrent?title=Hello%20World';
}
/* Revert Dynamic Titles */
if (navigator.userAgent.indexOf('gonative') > -1) {
  window.location.href = 'gonative://navigationTitles/set?persist=true';
}
/* Custom Icon Configuration */
"navigation": {
    "actionConfig": {
      "actionSelection": [{
        "id": "cartAction",
        "regex": ".*"
      }],
      "actions": [{
        "items": [{
          "url": "javascript:alert('shopping cart clicked');",
          "icon": "fas fa-shopping-cart",
          "label": "Shopping Cart"
        }],
        "id": "cartAction"
      }],
      "active": true
    }
}