Skip to content

Instantly share code, notes, and snippets.

@mikrobi
mikrobi / fun.md
Created October 14, 2019 09:57
Gist for fun

This is a test

@mikrobi
mikrobi / gist:6182683
Created August 8, 2013 08:21
Use `CDVInvokedUrlCommand ` as parameter to make the `setApplicationIconBadgeNumber` method callable from JavaScript
- (void)setApplicationIconBadgeNumber:(CDVInvokedUrlCommand*)command; {
DLog(@"setApplicationIconBadgeNumber:%@\n", command.arguments);
self.callbackId = command.callbackId;
NSMutableDictionary* options = [command.arguments objectAtIndex:0];
int badge = [[options objectForKey:@"badge"] intValue] ?: 0;
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:badge];