0

我正在使用这个例子 https://github.com/phonegap/phonegap-plugins/tree/master/Android/StatusBarNotification

但我不能通过“标签”。

例子说......

window.plugins.statusBarNotification.notify("Put your title here", "Put your message here");

我应该在哪里更改代码以使其接受“标签”作为参数?

我想要做

window.plugins.statusBarNotification.notify("11", "Put your title here", "Put your message here");

4

1 回答 1

1

NotificationMessenger.prototype.notify()将 statusbarnotification.js更改为:

/**
 * @param tag Tag of the notification
 * @param title Title of the notification
 * @param body Body of the notification
 * @deprecated Use the W3C standard window.Notification API instead.
 */
NotificationMessenger.prototype.notify = function(tag, title, body, flag) {
    if (window.Notification) {
        this.activeNotification = new window.Notification(title, {
            body: body,
            flag: flag,
            tag: tag
        });
    }
}

然后你可以调用:

window.plugins.statusBarNotification.notify("11", "Put your title here", "Put your message here");
于 2013-06-27T07:35:47.287 回答