Silent push notifications only delivered if device is charging and/or app is foreground

I have implemented silent push notifications but I have noticed some strange behaviour. The silent push notifications are handled via: – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler The silent push messages only seem to be received if the device is charging (ie cable connected) and/or if my app is foreground. If I disconnect the device … Read more

Changing background color of selected cell?

Does anyone know how to change the background color of a cell using UITableViewCell, for each selected cell? I created this UITableViewCell inside the code for TableView. Answer Changing the property selectedBackgroundView is correct and the simplest way. I use the following code to change the selection color: // set selection color UIView *myBackView = … Read more

ImageMagick extend canvas with transparent background

convert input.png -extent 100×100 -gravity center -background white output.png If the input is 50×50 the surrounding background is white. Can I somehow set this to transparent without declaring any color within input as transparent? Answer Use this instead: convert \ input.png \ -background none \ -gravity center \ -extent 100×100 \ output.png Note well: The … Read more

Check if color is dark or light in Android

as per title, my question is: Does Android provide any way to analyze/determine if a color (that will be obviously dynamic for the purpose) is light or dark? Answer Android doesn’t provide it, you can implement a method to determine this. Here a method to do that: public boolean isColorDark(int color){ double darkness = 1-(0.299*Color.red(color) … Read more