1. #1
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    574
    Vote Rating
    31
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default 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:

    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.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,087
    Vote Rating
    855
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Moved to the showcases forum.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    574
    Vote Rating
    31
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Moved to the showcases forum.
    I did not want to post it there, because if someone has a poblem, Q&A might be the place to search. But I guess you know the hits better than I do.
    Thanks

Thread Participants: 1

Tags for this Thread