Commit 5dc8b661 authored by Sebastián Katzer's avatar Sebastián Katzer
Browse files

Re-add autoCancel option on Android

parent 2efe9232
Loading
Loading
Loading
Loading
+1 −1
Changes for src/android/notification/Builder.java: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ public class Builder {
                .setTicker(options.getText())
                .setSmallIcon(options.getSmallIcon())
                .setLargeIcon(options.getIconBitmap())
                .setAutoCancel(true)
                .setAutoCancel(options.isAutoClear())
                .setOngoing(options.isOngoing())
                .setStyle(style)
                .setLights(options.getLedColor(), 500, 500);
+8 −1
Changes for src/android/notification/Options.java: 8 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -175,12 +175,19 @@ public class Options {
    }

    /**
     * Android only ongoing flag for local notifications.
     * ongoing flag for local notifications.
     */
    public Boolean isOngoing() {
        return options.optBoolean("ongoing", false);
    }

    /**
     * autoClear flag for local notifications.
     */
    public Boolean isAutoClear() {
        return options.optBoolean("autoClear", false);
    }

    /**
     * Trigger date in milliseconds.
     */
+7 −0
Changes for www/local-notification-util.js: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ exports.applyPlatformSpecificOptions = function () {
        defaults.icon      = 'res://icon';
        defaults.smallIcon = 'res://ic_popup_reminder';
        defaults.ongoing   = false;
        defaults.autoClear = true;
        defaults.led       = 'FFFFFF';
        break;
    }
@@ -86,6 +87,12 @@ exports.mergeWithDefaults = function (options) {
    options.text = this.getValueFor(options, 'text', 'message');
    options.data = this.getValueFor(options, 'data', 'json');

    options.autoClear = this.getValueFor(options, 'autoClear', 'autoCancel');

    if (options.autoClear !== true && options.ongoing) {
        options.autoClear = false;
    }

    if (options.at === undefined || options.at === null) {
        options.at = new Date();
    }