Updating iOS badge without push notifications

Try this [[UIApplication sharedApplication] setApplicationIconBadgeNumber:1]; To do this through local notifications you have to set the value in applicationIconBadgeNumber UILocalNotification *localNotification = [[UILocalNotification alloc] init]; localNotification.applicationIconBadgeNumber = 1;// set here the value of badge

How to remove notification from notification bar programmatically in android?

Maybe try this : NotificationManager notificationManager = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancel(NOTIFICATION_ID); OR, you can also do this to cancel all notifications in given context: notificationManager.cancelAll(); See this link to the documentation : NotificationManager

catch on swipe to dismiss event

DeleteIntent: DeleteIntent is a PendingIntent object that can be associated with a notification and gets fired when the notification gets deleted, ether by : User specific action User Delete all the notifications. You can set the Pending Intent to a broadcast Receiver and then perform any action you want. Intent intent = new Intent(this, MyBroadcastReceiver.class); … Read more

Easiest CSS for “red notification badge” with count

The best way to achieve this is by using absolute positioning: /* Create the blue navigation bar */ .navbar { background-color: #3b5998; font-size: 22px; padding: 5px 10px; } /* Define what each icon button should look like */ .button { color: white; display: inline-block; /* Inline elements with width and height. TL;DR they make the … Read more

How to get focus to a Chrome tab which created desktop notification?

You can just place window.focus() in Google Chrome. It will focus to that window when clicked. var n = window.webkitNotifications.createNotification(‘ico.gif’, ‘Title’, ‘Text’); n.onclick = function(x) { window.focus(); this.close(); }; n.show(); I opened the inspector in Gmail, added the above code, moved to a different tab, and ran it. The notification appeared and once clicked, it … Read more

Get notification when NSOperationQueue finishes all tasks

Use KVO to observe the operations property of your queue, then you can tell if your queue has completed by checking for [queue.operations count] == 0. Somewhere in the file you’re doing the KVO in, declare a context for KVO like this (more info): static NSString *kQueueOperationsChanged = @”kQueueOperationsChanged”; When you setup your queue, do … Read more

Best way to serialize an NSData into a hexadeximal string

This is a category applied to NSData that I wrote. It returns a hexadecimal NSString representing the NSData, where the data can be any length. Returns an empty string if NSData is empty. NSData+Conversion.h #import <Foundation/Foundation.h> @interface NSData (NSData_Conversion) #pragma mark – String Conversion – (NSString *)hexadecimalString; @end NSData+Conversion.m #import “NSData+Conversion.h” @implementation NSData (NSData_Conversion) #pragma … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)