Have any questions?

+44 (20) 3540 6226

hello@appshed.com

How do I hide the built in alert messages?

5.0/5 rating (1 votes)
  • To hide the alerts you need to paste some code into the Custom JavaScript field in the app.
  • Open your app in the App Buidler,
  • Go to Settings,
  • Go to the Advanced tab,
  • Scroll down to Custom JavaScript and
  • Paste in this code:

 

//Replacement for alert
appbuilder.app.alert = function(message, context) {

// don't show these
if(message == "Downloading updates to app" || message == "App is now available offline")
return;

if(appbuilder.app.isPhoneGap) {
navigator.notification.alert(message);
}
else if(appbuilder.app.isMobile) {
alert(message);
}
else {
appbuilder.app.makeConfirm(message, null, null, null, false).inject(document.id(context || document.getElement('.phone-inner') || document.getElement('.phone') || document.body));
}
};

 

 

 

Share this product

appshed name white text 250

Copyright © 2017 AppShed Limited