notifications

android.app.RemoteServiceException: Bad notification for startForeground

末鹿安然 提交于 2021-01-27 07:06:43
问题 I'm trying to start foreground service as follow: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { NotificationChannel chan = new NotificationChannel( getApplicationContext().getPackageName(), "My Foreground Service", NotificationManager.IMPORTANCE_LOW); chan.setLightColor(Color.BLUE); chan.setLockscreenVisibility(Notification.VISIBILITY_SECRET); NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); assert manager != null; manager

Receive notification for power cord on/off in OSX Cocoa for the laptop

[亡魂溺海] 提交于 2021-01-24 09:55:18
问题 ALL, Does OSX sends any notification when the power cord is plugged/unplugged in the Mac laptop? Or plugging/unplugging the laptop from the docking station? It does send something on shutdown/reboot/wake-up/etc, but I didn't find anything for that specific event. Am I missing something? Or this is not available? TIA! 回答1: There are no high-level notifications, but the IOPowerSources framework can post a message to your run loop whenever the power state changes. My project has multiple

How to determine client's country using Google Analytics?

纵饮孤独 提交于 2021-01-05 10:47:39
问题 My page uses GA to provide myself with statistics. I can later see countries that were most visiting my site. Are there any way to get client's country at the client-side? I would like to show user a notification if she is not from my country. 回答1: You don't have access to that information in the browser using GA. If you want to access that information in the browser Try geolocation in browsers whom support it. spec. http://dev.w3.org/geo/api/spec-source.html demo: http://html5demos.com/geo

How to determine client's country using Google Analytics?

只谈情不闲聊 提交于 2021-01-05 10:44:14
问题 My page uses GA to provide myself with statistics. I can later see countries that were most visiting my site. Are there any way to get client's country at the client-side? I would like to show user a notification if she is not from my country. 回答1: You don't have access to that information in the browser using GA. If you want to access that information in the browser Try geolocation in browsers whom support it. spec. http://dev.w3.org/geo/api/spec-source.html demo: http://html5demos.com/geo

Flutter - change appbar icon when receiving notification

牧云@^-^@ 提交于 2021-01-02 07:57:36
问题 I am using FirebaseMessaging to push notifications on my app. So I can handle these notification with this code : firebaseMessaging.configure( onLaunch: (Map<String, dynamic> msg) { print("onLaunch called"); }, onResume: (Map<String, dynamic> msg) { print("onResume called"); }, onMessage: (Map<String, dynamic> msg) { print("onMessage called : " + msg.toString()); }); When I receive a notification, I want to display this little '1' on my icon in my appbar My problem is : I don't know how to

Flutter - change appbar icon when receiving notification

Deadly 提交于 2021-01-02 07:57:26
问题 I am using FirebaseMessaging to push notifications on my app. So I can handle these notification with this code : firebaseMessaging.configure( onLaunch: (Map<String, dynamic> msg) { print("onLaunch called"); }, onResume: (Map<String, dynamic> msg) { print("onResume called"); }, onMessage: (Map<String, dynamic> msg) { print("onMessage called : " + msg.toString()); }); When I receive a notification, I want to display this little '1' on my icon in my appbar My problem is : I don't know how to

How can I disable firebase notification on android client app

寵の児 提交于 2021-01-01 04:57:10
问题 I want to disable firebase notification service when the user turns off notification through settings. I found questions on this topic: Firebase on Android - I want to disable firebase notifications on Android client and android FCM enable/disable from application settings but answers are an alternative way for ignoring notifications. Is there any other way to unregister firebase notifications. Thankyou 回答1: Use this. FirebaseMessaging.getInstance().unsubscribeFromTopic("X"); 回答2: I spent a

MacOS App Local Notification Not Showing when testing with XCode

泪湿孤枕 提交于 2020-12-31 10:54:28
问题 I have tried to add a banner notification generator to my macOS swift app and the banner does not appear when test running in XCode and neither are there any new notifications visible in the notification centre. Other apps on my computer are generating notifications regularly. What have I missed? I have granted permission when requested My app delegate is as follows class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDelegate { @IBOutlet weak var mainMenu: NSMenu! func

MacOS App Local Notification Not Showing when testing with XCode

被刻印的时光 ゝ 提交于 2020-12-31 10:50:13
问题 I have tried to add a banner notification generator to my macOS swift app and the banner does not appear when test running in XCode and neither are there any new notifications visible in the notification centre. Other apps on my computer are generating notifications regularly. What have I missed? I have granted permission when requested My app delegate is as follows class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDelegate { @IBOutlet weak var mainMenu: NSMenu! func

MacOS App Local Notification Not Showing when testing with XCode

拈花ヽ惹草 提交于 2020-12-31 10:45:15
问题 I have tried to add a banner notification generator to my macOS swift app and the banner does not appear when test running in XCode and neither are there any new notifications visible in the notification centre. Other apps on my computer are generating notifications regularly. What have I missed? I have granted permission when requested My app delegate is as follows class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDelegate { @IBOutlet weak var mainMenu: NSMenu! func