Commit 8c8db7bb authored by Bob Easterday's avatar Bob Easterday
Browse files

Fix Application badge number issue for >3.0

parent 486c8771
Loading
Loading
Loading
Loading
+1 −1
Changes for plugin.xml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
    xmlns:android="http://schemas.android.com/apk/res/android"
    id="com.phonegap.plugins.PushPlugin"
    version="2.0.2">
    version="2.0.3">

    <name>PushPlugin</name>
	<author>Bob Easterday</author>
+4 −4
Changes for src/ios/PushPlugin.m: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -198,17 +198,17 @@
    }
}

- (void)setApplicationIconBadgeNumber:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options {
	DLog(@"setApplicationIconBadgeNumber:%@\n withDict:%@", arguments, options);
- (void)setApplicationIconBadgeNumber:(CDVInvokedUrlCommand *)command {

	self.callbackId = [arguments pop];
    self.callbackId = command.callbackId;

    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]];
}

-(void)successWithMessage:(NSString *)message
{
    CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:message];