> On 31 Aug 2016, at 10:42 AM, Graham Cox <graham....@bigpond.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to