• 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: Exception on launch when clicking on an NSUserNotification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exception on launch when clicking on an NSUserNotification


  • Subject: Re: Exception on launch when clicking on an NSUserNotification
  • From: Graham Cox <email@hidden>
  • Date: Fri, 27 Feb 2015 15:12:22 +1100

OK, I may be having a massive misunderstanding about how iOS works (as compared with Mac OS), but the NSUserNotification you post is, as far as I'm aware, completely unrelated to the NSNotification that is passed to -applicationWill/DidFinishLaunching.

The latter is just a notification that the application created internally, and as a convenience passed to its delegate before or after broadcasting it using NSNotificationCenter.

The user notification you post just triggers the notification system. I realise it's pretty confusing with everything being called more or less the same thing, but they are totally different. The userInfo you pass in your user notificaiton will not turn up in the app delegate's did launch notification. (Unless, that is, iOS is documented to do that. Mac OS definitely doesn't).

--Graham






> On 27 Feb 2015, at 1:17 pm, Alex Kac <email@hidden> wrote:
>
> However I'm having a problem on launching the app by tapping on the notification. My app gets an applicationWillFinishLaunching, and then gets an exception before it hits applicationDidFinishLaunching.
>
> https://www.dropbox.com/s/nmf6qr97su43plh/Screenshot 2015-02-25 21.38.37.png?dl=0
>
> I can continue, and the app then runs…but no NSApplicationLaunchUserNotificationKey in the notification.
> NSConcreteNotification 0x6100002555d0 {name = NSApplicationDidFinishLaunchingNotification; object = <PIApplication: 0x618000115570>; userInfo = {
>    NSApplicationLaunchIsDefaultLaunchKey = 0;
> }}
>
> I am debugging the launch by using XCode's "Wait for executable to be launched" option in the scheme, then tapping on my notification to launch the app.
>
> There is no info in the console.
>
> The notification being scheduled is:
> <NSUserNotification:0x10149d2c0> { title: "Test" informativeText: "9:55 PM" actionButtonTitle: "Snooze" next delivery date: 2015-02-26 04:54:47 +0000 }
>
> I am using 10.10 action item (snooze options). I’ve Googled this with no luck. My only guess was that there was something in the notification that wasn’t decodeable…but I’ve checked every property of the notification just to be sure I didn’t do something stupid and its all good.
>


_______________________________________________

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


  • Follow-Ups:
    • Re: Exception on launch when clicking on an NSUserNotification
      • From: Alex Kac <email@hidden>
    • Re: Exception on launch when clicking on an NSUserNotification
      • From: Graham Cox <email@hidden>
    • RE: Exception on launch when clicking on an NSUserNotification
      • From: Lee Ann Rucker <email@hidden>
    • Re: Exception on launch when clicking on an NSUserNotification
      • From: Graham Cox <email@hidden>
References: 
 >Exception on launch when clicking on an NSUserNotification (From: Alex Kac <email@hidden>)

  • Prev by Date: Re: How to prevent app activation on NSUserNotification action
  • Next by Date: Re: Exception on launch when clicking on an NSUserNotification
  • Previous by thread: Re: Exception on launch when clicking on an NSUserNotification
  • Next by thread: Re: Exception on launch when clicking on an NSUserNotification
  • Index(es):
    • Date
    • Thread