Is there a simple way to edit / modify a UILocalNotification

If the documentation is correct, you can’t alter an already scheduled notification. The doc states for -scheduleLocalNotification:: […] Because the operating system copies notification, you may release it once you have scheduled it. The notification object is copied by the system and not accessible via any (public) method. So there’s no other solution than canceling … Read more

Is it possible to send Toast notification from console application?

At first you need to declare that your program will be using winRT libraries: Right-click on your yourProject, select Unload Project Right-click on your yourProject(unavailable) and click Edit yourProject.csproj Add a new property group:<targetplatformversion>8.0</targetplatformversion> Reload project Add reference Windows from Windows > Core Now you need to add this code: using Windows.UI.Notifications; and you will … Read more

How to post and receive an NSNotifications (Objective C) | Notifications (in Swift)?

Send a notification: [[NSNotificationCenter defaultCenter] postNotificationName:@”MyCacheUpdatedNotification” object:self]; Receive it: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(cacheUpdated:) name:@”MyCacheUpdatedNotification” object:nil]; Act on it: – (void)cacheUpdated:(NSNotification *)notification { [self load]; } And dispose of it: [[NSNotificationCenter defaultCenter] removeObserver:self];

Starting app only if its not currently running

Use a “launch Intent” for your app, like this: PackageManager pm = getPackageManager(); Intent launchIntent = pm.getLaunchIntentForPackage(“your.package.name”); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, launchIntent, 0); Replace “your.package.name” with the name of your package from the Android manifest. Also, you should remove the special launchMode=”singleTask” from your manifest. Standard Android behaviour will do what you want.

Light up screen when notification received android

PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE); boolean isScreenOn = pm.isScreenOn(); Log.e(“screen on……..”, “”+isScreenOn); if(isScreenOn==false) { WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK |PowerManager.ACQUIRE_CAUSES_WAKEUP |PowerManager.ON_AFTER_RELEASE,”myApp:MyLock”); wl.acquire(10000); WakeLock wl_cpu = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,”myApp:mycpuMyCpuLock”); wl_cpu.acquire(10000); }

Check if Local Notifications are enabled in IOS 8

You can check it by using UIApplication ‘s currentUserNotificationSettings if ([[UIApplication sharedApplication] respondsToSelector:@selector(currentUserNotificationSettings)]){ // Check it’s iOS 8 and above UIUserNotificationSettings *grantedSettings = [[UIApplication sharedApplication] currentUserNotificationSettings]; if (grantedSettings.types == UIUserNotificationTypeNone) { NSLog(@”No permiossion granted”); } else if (grantedSettings.types & UIUserNotificationTypeSound & UIUserNotificationTypeAlert ){ NSLog(@”Sound and alert permissions “); } else if (grantedSettings.types & UIUserNotificationTypeAlert){ NSLog(@”Alert … Read more

How to add button to notifications in android?

You can create an intent for the action (in this case stop playing) and then add it as an action button to your notification. Intent snoozeIntent = new Intent(this, MyBroadcastReceiver.class); snoozeIntent.setAction(ACTION_SNOOZE); snoozeIntent.putExtra(EXTRA_NOTIFICATION_ID, 0); PendingIntent snoozePendingIntent = PendingIntent.getBroadcast(this, 0, snoozeIntent, 0); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this, CHANNEL_ID) .setSmallIcon(R.drawable.notification_icon) .setContentTitle(“My notification”) .setContentText(“Hello World!”) .setPriority(NotificationCompat.PRIORITY_DEFAULT) .setContentIntent(pendingIntent) .addAction(R.drawable.ic_snooze, getString(R.string.snooze), … Read more