Commit 26c9c59c authored by Simon MacDonald's avatar Simon MacDonald
Browse files

Merge pull request #43 from Deminetix/issue42

fix issue #42
parents f5b14a64 42f31de7
Loading
Loading
Loading
Loading
+5 −5
Changes for src/ios/PushPlugin.m: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -239,16 +239,16 @@
    }
}

- (void)setApplicationIconBadgeNumber:(CDVInvokedUrlCommand *)command {

    self.callbackId = command.callbackId;

- (void)setApplicationIconBadgeNumber:(CDVInvokedUrlCommand *)command 
{
    NSMutableDictionary* options = [command.arguments objectAtIndex:0];
    int badge = [[options objectForKey:@"badge"] intValue] ?: 0;

    [[UIApplication sharedApplication] setApplicationIconBadgeNumber:badge];

    [self successWithMessage:[NSString stringWithFormat:@"app badge count set to %d", badge]];
    NSString* message = [NSString stringWithFormat:@"app badge count set to %d", badge];
    CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:message];
    [self.commandDelegate sendPluginResult:commandResult callbackId:command.callbackId];
}

-(void)successWithMessage:(NSString *)message
+1 −1
Changes for www/push.js: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ PushNotification.prototype.setApplicationIconBadgeNumber = function(successCallb
        return
    }

    cordova.exec(successCallback, errorCallback, "PushNotification", "setApplicationIconBadgeNumber", [{badge: badge}]);
    exec(successCallback, errorCallback, "PushNotification", "setApplicationIconBadgeNumber", [{badge: badge}]);
};

/**