How to customize show time of NSUserNotification when using banner type - nsusernotificationcenter

On Mac OS 10.8, the banner is shown a few seconds and disappeared automatically,
so how to set the duration to show the banner with code.
I also read NSUserNotification API document, it seems only has API to schedule and repeat the notification.

Related

Flutter Firebase DebugView not sending events

Initially the person before me set up a screen observer so that whenever the page changes, setCurrentScreen is triggered to send a event and log the screen. Because we use a bunch of open containers to animate page opening, the screen observer doesnt get triggered. So I went through the app and added some setCurrentScreen for those that the screenObserver missed, and while there I also added some logEvents to see if people are using specific parts of the app.
The way I set enabled debug view was in xcode, going to Product -> Scheme -> Edit Scheme and adding -FIRAnalyticsDebugEnabled and -FIRDebugEnabled Edit scheme
After ticking both of the above (or just one or the other), only these events are being triggered then the app stops sending events. Completely. What am I missing? output
I cannot find another issue about this. I am using the same package name in the app and firebase, otherwise I would have no output. All other issues are talking about no output at all. I have tried to do this on simulator and on actual iPhone and they both yield the same result. I have also set up a android emulator and have an actual phone. Tried it on both and same result. The above screenshot is from iPhone as I am on Mac and more comfortable working on a iPhone.
i have set IS_ANALYTICS_ENABLED to true in the .plist file and this did not work

How to show dot badge instead of counter badge in app launcher icon?

I am using flutter_local_notifications: ^9.7.0 to show notification and that's really nice package, using that package I am available to get badge with icon "1" when notification pops up. What I would like to ask.. instead of showing "1" badge, I would like to show dot badge. Is there a way to do that using flutter_local_notifications or any other package ?
Notification Badges are Platform's entity & unfortunately, you can not do anything to change it.
As mentioned in Android docs
These dots appear by default in launcher apps that support them and there's nothing your app needs to do.

Xcode Swift 5 MacOs app empty window when archived but works when running it from Xcode

I am building an app for Mac which logs into a website based on login and password collected from textfield and secure text field, then app opens an url which is created in my app based on date range selection with use of two date picker cell calendars. Next app displays html data in webWiev (using WKWebView), converts html to string using extension NSAttributedString and then saves retrieved data as txt file. Everything works as expected as long as app is run from Xcode "play" button. Problem is if I archive this app and launch it, it will bring up an empty window without any button, calendar or textfield. There are no errors, no crash logs on organizer, nothing.
I decided to perform a little test. I build another view controller with only one button which upon clicking will show my app main view controller. After archiving this modified app and running it outside of Xcode a window shows view controller with one button which is correct. But after clicking it nothing happens. App works great if running "inside" Xcode, a pushbutton shows main ViewController correctly. Do You have any clue what can be wrong? thank You!
Edit 1. So I found a discussion on apple which mention this problem. It is associated with IB WKWebView and problem is already known since some time. Now I have to get around the problem. Apple forum link: https://forums.developer.apple.com/thread/116047
Did you embed WebKit.framework to your app?
After comment that I wrote, I founded a solution and solved with this method.
Please check it out.

iOS 10 Notification Content Extension not loading

I have a bare-bones app to play with push notifications. I have the Notification Service Extension working. I can send a remote notification with an image URL and have it load.
I can't seem to get Notification Content Extension working. I've gone through multiple tutorials and they all say, just create a Notification Content Extension from the target menu and then inside the Notification Content Extensions Info.plist set the
UNNotificationCategory
to some string. Then when you push the notification, inside the "aps" json-block make sure to have category the same as UNNotificationCategory.
When I receive a notification, I try to swipe it down, left or right and nothing really happens. However, the service extension is working great.
I am using an iPhone 5 with ios 10 and XCode 8.0. I read that at one point only devices with 3d touch could view the content extension but that has since changed since xCode 8 is out of beta.
Any ideas? How can I go about debugging this? I've tried running the app with the Notification Extension selected and printing out stuff inside
didReceive
but am not having any luck.
Make sure to set the Extension's deployment target to the same as your Application target.
Please check if you set the category identifier in your UNMutableNotificationContent() For e.g.
let content = UNMutableNotificationContent()
content.categoryIdentifier = "awesomeNotification"
where "awesomeNotification" is the identifier for your UNNotificationCategory
Such problem. iOS Content Extension work fine with iPhone 5s, SE, iPad2mini, but doesn't work with iPhoine 5, 5c:
UNUserNotificationCenter.current().supportsContentExtensions is false on iPhoine 5, 5c
Despite what I read elsewhere on stackoverflow and online, expanding the push notification did not work on an iPhone 5 and IOS 10. I borrowed an iPhone 6+ and my code worked fine.
For me it was due to changing signing certificates. I was able to resolve it by:
Deleting the app (and all apps in app group)
Restarting phone
Quitting Xcode
Cleaning project
Running again

iPhone notification icon

On my program icon i want to show how many show a number, like on the AppStore program icon, where it shows how many updates are available. How can i implement this on my own program icon?
Your application can add a badge icon number by calling:
[UIApplication sharedApplication].applicationIconBadgeNumber = 1; // any NSInteger
This is available in iPhone 2.0, but in 3.0 the application doesn't have to be running to update the number using the push notification service (requires server in the cloud).