-
2 Mar 2013 3:32 AM #1
PhoneGap Notification issue
PhoneGap Notification issue
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:
I hope you find this helpful.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); } });
-
4 Mar 2013 7:58 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
Moved to the showcases forum.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
4 Mar 2013 11:01 AM #3


Reply With Quote
