Search code examples
extjssencha-touch-2

Sencha MessageBox vs Notification usage preference


Sencha Touch has 2 classes Ext.device.Notification and Ext.Msg to display messages. As per documentation of Ext.device.Notification Notifications are used to show native dialog boxes. The Simulator implementation will use Ext.MessageBox for show and a simply animation when you call vibrate. In otherwords, while testing in simulator/chrome emulation, Notifications behaves like MessageBox. But on actual device, it launches native device notification.

So I was wondering why would we not always use Ext.device.Notification to show Notifications ? Is there a need to use Ext.Msg? Are there any performance issues of using Notification over Msg?


Solution

  • Haven't used Ext.device.Notification so far but it seems that you can not style this type of message as you could style Ext.Msg. So it should be easier to include Ext.Msg into your app theme and have a consistent look.

    On the other hand (as you already mentioned) you can vibrate the device using Ext.device.Notification. This is not possible using Ext.Msg though.

    That being said these two classes are not completely interchangeable.