(function () { function showInfo(url) { var html = ''; html += '
'; html += '
'; html += '
'; html += '

' + Globalize.translate('HeaderEmbyForAndroidHasMoved') + '

'; html += '

'; html += Globalize.translate('MessageEmbyForAndroidHasMoved'); html += '

'; html += '

'; html += '' + Globalize.translate('ButtonViewNewApp') + ''; html += '

'; html += '

'; html += '' + Globalize.translate('ButtonCancel') + ''; html += '

'; html += '
'; html += '
'; html += '
'; $(document.body).append(html); } function showNewAppIfReady() { var platform = (window.device ? device.platform : '') || ''; platform = platform.toLowerCase(); var oldApp = platform.indexOf('amazon') == -1 ? 'com.mb.android.google' : 'com.mb.android.amazon'; HttpClient.send({ type: "GET", url: "https://mb3admin.com/admin/service/appstore/newAppInfo?oldApp=" + oldApp, dataType: 'json' }).done(function (result) { // Overly defensive, but don't want any failures here result = result || {}; if (result.newAppActive) { showInfo(result.newAppUrl); } }).fail(function () { Logger.log('showNewAppIfReady failed'); }); } function showInfoIfNeeded() { var key = 'lastNewAppShow'; var lastShow = parseInt(appStorage.getItem(key) || '0'); if ((new Date().getTime() - lastShow) > 86400000) { showNewAppIfReady(); appStorage.setItem(key, new Date().getTime().toString()); } else { //showNewAppIfReady(); } } setTimeout(showInfoIfNeeded, 1000); document.addEventListener("resume", showInfoIfNeeded, false); })();