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 = 'median://navigationTitles/set?persist=true&data=' + encodeURIComponent(json);
/* Set Current Page Title */
if (navigator.userAgent.indexOf('median') > -1) {
window.location.href = 'median://navigationTitles/setCurrent?title=Hello%20World';
}
/* Revert Dynamic Titles */
if (navigator.userAgent.indexOf('median') > -1) {
window.location.href = 'median://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
}
}
Updated about 2 months ago
Next Steps