Determine addAction click for Android notifications

It’s because you’re using FLAG_UPDATE_CURRENT with Intents that have the same action From the docs: if the described PendingIntent already exists, then keep it but its replace its extra data with what is in this new Intent. When you specify pendingIntentMaybe and pendingIntentNo, the system uses the PendingIntent created for pendingIntentYes, but it overwrites the … Read more

Send desktop notifications in Chrome or Firefox from a closed web app?

You can send push notifications even when your web page is not active using Service Workers, the Notification API for service workers and the push API for server-initiated notifications (or scheduled notifications). As of June 2016, Service Workers are supported in Chrome, Firefox and Opera. See the status at https://jakearchibald.github.io/isserviceworkerready/ See the following links for … Read more

Cocoa Custom Notification Example

@implementation MyObject // Posts a MyNotification message whenever called – (void)notify { [[NSNotificationCenter defaultCenter] postNotificationName:@”MyNotification” object:self]; } // Prints a message whenever a MyNotification is received – (void)handleNotification:(NSNotification*)note { NSLog(@”Got notified: %@”, note); } @end // somewhere else MyObject *object = [[MyObject alloc] init]; // receive MyNotification events from any object [[NSNotificationCenter defaultCenter] addObserver:object selector:@selector(handleNotification:) … Read more

How to bring up list of available notification sounds on Android

Just copy/pasting some code from one of my apps that does what you are looking for. This is in an onClick handler of a button labeled “set ringtone” or something similar: Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, “Select Tone”); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, (Uri) null); this.startActivityForResult(intent, 5); And this code captures the choice made by the … Read more

android pending intent notification problem

The way I solved that problem was by assigning a unique requestCode when you get the PendingIntent: PendingIntent.getActivity(context, requestCode, showIntent, 0); By doing so you are registering with the system different/unique intent instances. Tip: A good way of making the requestCode unique would be by passing to it the current system time. int requestID = … Read more

Custom notification layouts and text colors

The solution is to use built-in styles. The style you need is called TextAppearance.StatusBar.EventContent in Android 2.3 and Android 4.x. In Android 5.x material notifications use several other styles: TextAppearance.Material.Notification, TextAppearance.Material.Notification.Title, and TextAppearance.Material.Notification.Line2. Just set the appropriate text appearance for the text view, and you will get the necessary colors. If you are interested how … Read more

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