notifications

Android Badge number on launcher icon for all mobile manufacturer

前提是你 提交于 2020-01-22 07:41:48
问题 I need a badge counter on my application launcher icon. I know the solution to get Badge counter inside the app, using TextView, But I need a solution to get the badge counter external to the app on the launcher icon. In iOS we get the badge number count by UIApplication.sharedApplication().applicationIconBadgeNumber I am wondering why Android has not included anything like this with their SDK which every developer need. Try 1 : Working only on sony mobiiles : Intent badgeIntent = new Intent(

Android Badge number on launcher icon for all mobile manufacturer

心已入冬 提交于 2020-01-22 07:41:06
问题 I need a badge counter on my application launcher icon. I know the solution to get Badge counter inside the app, using TextView, But I need a solution to get the badge counter external to the app on the launcher icon. In iOS we get the badge number count by UIApplication.sharedApplication().applicationIconBadgeNumber I am wondering why Android has not included anything like this with their SDK which every developer need. Try 1 : Working only on sony mobiiles : Intent badgeIntent = new Intent(

Use NSNotificationCenter selector for one observer in multiple view controllers

隐身守侯 提交于 2020-01-22 02:08:51
问题 Can I use the selector getUpdate: in multiple view controllers? I'm registering my LevelViewController as an observer for both GameViewController and WinViewController . The latter 2 view controllers both have a back button (which, when pressed, pops you back to LevelVC ), and the idea with the notification is to tell LevelVC whether or not to update the collection view cells (via the viewWillAppear: method) when the back button is pressed. In viewWillAppear: , I wouldn't want to call two

How can remove all Chrome notifications in load view with JavaScript?

可紊 提交于 2020-01-21 12:27:26
问题 This is my code to show notification in Google Chrome. How can I close notification in code? document.addEventListener('DOMContentLoaded', function() { if (!Notification) { alert('Desktop notifications not available in your browser. Try Chromium.'); return; } if (Notification.permission !== "granted") Notification.requestPermission(); }); function notifyMe() { if (Notification.permission !== "granted") Notification.requestPermission(); else { var notification = new Notification('test', { icon

Xamarin Forms - Processing a Notification Click

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-21 11:57:40
问题 I have a Xamarin Forms application which raises an Android Notification but I'm having trouble creating a simple page that will interact with the user when they click the Notification. I understand that in Xamarin.Forms there is only 1 activity and so the pending Intent must be to that mainActivity I have set the LaunchMode to SingleTop and and Intent Filter to match the Intent name used in the pendingIntent Now when I click the Notification I do get routed to the OnResume of the MainActivity

Setting sounds for local notifications on a 3G iPhone running iOS4

 ̄綄美尐妖づ 提交于 2020-01-21 07:40:20
问题 I have successfully scheduled local notifications in my app using the code below: Class cls = NSClassFromString(@"UILocalNotification"); if (cls != nil) { UILocalNotification *notification = [[cls alloc] init]; notification.fireDate = self.alarmNotificationDate; notification.timeZone = [NSTimeZone defaultTimeZone]; notification.alertBody = @"Alarm is due"; notification.alertAction = @"Show Alarm"; notification.soundName = @"alarm.mp3"; [[UIApplication sharedApplication]

Setting sounds for local notifications on a 3G iPhone running iOS4

大城市里の小女人 提交于 2020-01-21 07:40:06
问题 I have successfully scheduled local notifications in my app using the code below: Class cls = NSClassFromString(@"UILocalNotification"); if (cls != nil) { UILocalNotification *notification = [[cls alloc] init]; notification.fireDate = self.alarmNotificationDate; notification.timeZone = [NSTimeZone defaultTimeZone]; notification.alertBody = @"Alarm is due"; notification.alertAction = @"Show Alarm"; notification.soundName = @"alarm.mp3"; [[UIApplication sharedApplication]

android How to start activity when user clicks a notification?

寵の児 提交于 2020-01-21 00:54:40
问题 I wanna open activity when user clicks a notification. I know this question is duplicated but couldn`t find a solution here is what i did NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.notification_icon) .setContentTitle("My notification") .setContentText("Hello World!"); Intent resultIntent = new Intent(this, ResultActivity.class); // Because clicking the notification opens a new ("special") activity, there's // no need to create an

How to properly use CFNotificationCenterAddObserver in Swift for iOS

半世苍凉 提交于 2020-01-20 21:56:59
问题 Pulling my hair out getting CFNotificationCenterAddObserver to work in Swift. CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), UnsafePointer<Void>(self), iosLocked, "com.apple.springboard.lockcomputer" as CFString, nil, CFNotificationSuspensionBehavior.DeliverImmediately) The iOS docs have it listed and I have tried countless iterations on the callback and the unsafe pointer with no success. The above function call results in this error message, which seems to be

Notification Listener Service does not work after app is crashed

萝らか妹 提交于 2020-01-19 14:21:30
问题 I have a problem on my app and I want to report this bug. I develope the app which can crawls notifications using NotificationListenerService. It works well. But NotificationListenerService class has the problem I think. Because, If the app is crashed, app can't crawl the notification at all, UNTIL the phone reboots. Is anyone who can solve this problem?? Please help me. The bug is very clear!! But It is not easy to find the solution .... 回答1: If do you have already permissions then: In your