Hi there,
I am using the native notifications inPhoneGap with Ext.device.Notification.
As the native code is broken at several points I wrote an override for this.
Here is the solution:
Code:
Ext.define('App.override.device.notification.PhoneGap', {
override: 'Ext.device.notification.PhoneGap',
show: function () {
var config = this.callParent(arguments),
buttons = (config.buttons),
onShowCallback = function (index) {
if (config.callback) {
config.callback.apply(config.scope, (config.buttons) ? [config.buttons[index - 1].itemId.toLowerCase()] : []);
}
};
var ln = buttons.length;
if (ln && typeof buttons[0] != "string") {
var newButtons = [], i;
for (i = 0; i < ln; i++) {newButtons.push(buttons[i].text);}
buttons = newButtons.join(',');
}
navigator.notification.confirm(config.message, onShowCallback, config.title, buttons);
}
});
I hope you find this helpful.