Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Uncaught Exception on launch from Push Notification
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
paul.obeda  
View profile  
 More options Aug 3 2011, 9:37 am
From: "paul.obeda" <paul.ob...@gmail.com>
Date: Wed, 3 Aug 2011 06:37:21 -0700 (PDT)
Local: Wed, Aug 3 2011 9:37 am
Subject: Uncaught Exception on launch from Push Notification
I am able to register my device and send a push notification (sandbox
cert), but when the alert launches my app it immediately crashes ...
any ideas?

Note: this happens whether I use the default alert and click "View",
or the no-button alert (which launches the app by default).

Thanks in advance!

----- Console extract follows, anonymized -----
Wed Aug  3 09:17:20 iPhone MyApp[1627] <Error>: -[__NSCFDictionary
absoluteString]: unrecognized selector sent to instance 0x14a030

Wed Aug  3 09:17:20 iPhone MyApp[1627] <Error>: *** Terminating app
due to uncaught exception 'NSInvalidArgumentException', reason: '-
[__NSCFDictionary absoluteString]: unrecognized selector sent to
instance 0x14a030'
        *** Call stack at first throw:
        (
                0   CoreFoundation                      0x3759dc7b
__exceptionPreprocess + 114
                1   libobjc.A.dylib                     0x32d9bee8
objc_exception_throw + 40
                2   CoreFoundation                      0x3759f3e3 -
[NSObject(NSObject) doesNotRecognizeSelector:] + 98
                3   CoreFoundation                      0x37544467 ___forwarding___
+ 506
                4   CoreFoundation                      0x37544220
_CF_forwarding_prep_0 + 48
                5   MyApp                        0x00002303 -[AppDelegate
application:didFinishLaunchingWithOptions:] + 182
                6   UIKit                               0x35924fd8 -[UIApplication
_callInitializationDelegatesForURL:payload:suspended:] + 1116
                7   UIKit                               0x3591ea78 -[UIApplication
_runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:]
+ 396
                8   UIKit                               0x358d82e4 -[UIApplication
handleEvent:withNewEvent:] + 1476
                9   UIKit                               0x358d7b1c -[UIApplication
sendEvent:] + 68
                10  UIKit                               0x358d73b4
_UIApplicationHandleEvent + 6824
                11  GraphicsServices                    0x33e77c88
PurpleEventCallback + 1048
                12  CoreFoundation                      0x3752f5cb
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 28
                13  CoreFoundation                      0x3752f589
__CFRunLoopDoSource1 + 164
                14  CoreFoundation                      0x37521835 __CFRunLoopRun +
580
                15  CoreFoundation                      0x3752150b
CFRunLoopRunSpecific + 226
                16  CoreFoundation                      0x37521419
CFRunLoopRunInMode + 60
                17  UIKit                               0x3591d554 -[UIApplication
_run] + 548
                18  UIKit                               0x3591a558 UIApplicationMain
+ 972
                19  MyApp                        0x000021b5 main + 80
                20  MyApp                        0x0000212c start + 52
        )

Wed Aug  3 09:17:20 iPhone
UIKitApplication:com.mycompany.myappid[0x31c5][1627] <Notice>:
terminate called after throwing an instance of 'NSException'

Wed Aug  3 09:17:22 iPhone ReportCrash[1628] <Notice>: Formulating
crash report for process MyApp[1627]

Wed Aug  3 09:17:22 iPhone com.apple.launchd[1]
(UIKitApplication:com.mycompany.myappid[0x31c5][1627]) <Warning>:
(UIKitApplication:com.mycompany.myappid[0x31c5]) Job appears to have
crashed: Abort trap

Wed Aug  3 09:17:22 iPhone SpringBoard[29] <Warning>: Application
'MyApp' exited abnormally with signal 6: Abort trap

Wed Aug  3 09:17:23 iPhone ReportCrash[1628] <Error>: Saved
crashreport to /var/mobile/Library/Logs/CrashReporter/
MyApp_2011-08-03-091720_iPhone.plist using uid: 0 gid: 0,
synthetic_euid: 501 egid: 0


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Henrique Souza  
View profile  
 More options Jul 2 2012, 8:44 am
From: Henrique Souza <henri...@thebrooklynbrothers.com>
Date: Mon, 2 Jul 2012 05:44:02 -0700 (PDT)
Local: Mon, Jul 2 2012 8:44 am
Subject: Re: Uncaught Exception on launch from Push Notification

Any chance you found out what the issue was?

Having the same problem here, though I can't seem to find any logs for it.

The app will only crash when not being open already though. If I launch it,
press the home button (so the app is still "open" in the background) and
send push notifications, once I tap the notification the app will open
without any issues.

So this seems to be in some part of the APNS code in the app delegate file,
but where?

Any help is appreciated!

Thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Henrique Souza  
View profile  
 More options Jul 2 2012, 9:13 am
From: Henrique Souza <henri...@thebrooklynbrothers.com>
Date: Mon, 2 Jul 2012 06:13:17 -0700 (PDT)
Local: Mon, Jul 2 2012 9:13 am
Subject: Re: Uncaught Exception on launch from Push Notification

Alright, never mind! I think I answered my own question there...

The thing is APNs are received in two ways, depending in the application
state, right... So, on the application didFinishLaunchingWithOptions
there's a code I'm not sure why it's there for, that was causing the crash:

self.invokeString = [url absoluteString];

Now, digging a little deeper and google came up with this:

http://stackoverflow.com/questions/7000438/ios-push-notification-term...

Which made me change this chunk of code:

 NSArray *keyArray = [launchOptions allKeys];

if ([launchOptions objectForKey:[keyArray objectAtIndex:0]]!=nil)

{

NSURL *url = [launchOptions objectForKey:[keyArray objectAtIndex:0]];

self.invokeString = [url absoluteString];

NSLog(@"Shoes launchOptions = %@",url);

}

To this:

NSArray *keyArray = [launchOptions allKeys];

if ([launchOptions objectForKey:[keyArray objectAtIndex:0]]!=nil)

{

NSURL *url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];

 if (url)

{

self.invokeString = [url absoluteString];

NSLog(@"listingApp launchOptions = %@", url);

}

  }

And it's all working, fine and dandy. Now, why that code was there for in
the way it was and why is it not documented that if you receive your
notifications while the app isn't loaded nor in the background, options get
received thru other handler? And how would I go about calling
didReceiveRemoteNotification from there, so I don't have to duplicate the
code in both handlers?

I hope this helps someone out there and if you could let me know any of the
above, I greatly appreciate it!

Thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »