• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSUserNotificationCenter configuration mysteries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSUserNotificationCenter configuration mysteries


  • Subject: Re: NSUserNotificationCenter configuration mysteries
  • From: Graham Cox <email@hidden>
  • Date: Wed, 31 Aug 2016 16:38:35 +1000

> On 31 Aug 2016, at 10:42 AM, Graham Cox <email@hidden> wrote:
>
> 				note.identifier = self.URL.absoluteString;
>
> 				[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:note];
> 			}
>
>
> I’m off to experiment, but if anyone knows how to tame the beast, it would save me some time.


OK, I solved this. It’s a bit strange though.

I set the note.identifier to a string from a URL which is different for different elements in the app. But setting the identifier to anything at all seems to stop the whole thing from working. If I don’t set an identifier, then the notification center works as I wish and as it is designed. If I set the identifier, even if I set it to different values, the notification center a) never shows a banner, even though it’s set to do so and my delegate should be forcing it to show it, and b) it only ever lists one notification for my app. I verified that each identifier is indeed unique.

So simply not setting an identifier fixes the problem.

I thought I needed the identifier to figure out which notification the user activated, but I can do that using userInfo, so that’s fine.

Bit odd though.

—Graham



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >NSUserNotificationCenter configuration mysteries (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Drawing issue with translucent borderless NSWindow, initial content half stays
  • Next by Date: Re: Drawing issue with translucent borderless NSWindow, initial content half stays
  • Previous by thread: NSUserNotificationCenter configuration mysteries
  • Index(es):
    • Date
    • Thread