Onesignal-ios-sdk: iOS 8 Crash on Init , When the app gets opened by a notification [XCODE 8] [IOS10 SDK] [LATEST OneSignal SDK]

Created on 6 Oct 2016  路  10Comments  路  Source: OneSignal/OneSignal-iOS-SDK

-[__NSCFString objectForKeyedSubscript:]: unrecognized selector sent to instance 0x1884fd50
+[OneSignalHelper getPushTitleBody:]
Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x23ff1fef __exceptionPreprocess
1  libobjc.A.dylib                0x322a3c8b objc_exception_throw
2  CoreFoundation                 0x23ff7409 __methodDescriptionForSelector
3  CoreFoundation                 0x23ff5327 ___forwarding___
4  CoreFoundation                 0x23f24e78 _CF_forwarding_prep_0
5  ________                       0x3b8f9b +[OneSignalHelper getPushTitleBody:] (OneSignalHelper.m:219)
6  ________                       0x3c876d +[OneSignal notificationOpened:isActive:] (OneSignal.m:741)
7  ________                       0x3be2e7 -[UIApplication(Swizzling) oneSignalRemoteSilentNotification:UserInfo:fetchCompletionHandler:] (UIApplication+Swizzling.m:122)
8  UIKit                          0x278b238d -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:]
9  UIKit                          0x278a9d4b -[UIApplication workspace:didReceiveActions:]
10 FrontBoardServices             0x2abbbec9 __31-[FBSSerialQueue performAsync:]_block_invoke_2
11 CoreFoundation                 0x23fb7fd5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
12 CoreFoundation                 0x23fb7299 __CFRunLoopDoBlocks
13 CoreFoundation                 0x23fb5dd3 __CFRunLoopRun
14 CoreFoundation                 0x23f02201 CFRunLoopRunSpecific
15 CoreFoundation                 0x23f02013 CFRunLoopRunInMode
16 GraphicsServices               0x2b7e1201 GSEventRunModal
17 UIKit                          0x276a6a59 UIApplicationMain
18 _________                       0x4ed51 main (main.m:16)
19 libdyld.dylib                  0x3282faaf start

And I'm sending this , It gets delivered but the app crashes when it's get opened by notification

issue noticed on iOS 8.3.0 iPhone 5 the build was by Xcode 8 , iOS 10 SDK

  $content = array(
    "en" => $text
  );

$filters = array(
    array("field" => "tag", "key" => $type, "relation" => "=", "value" => $value),

);

$fields = array(
  "app_id" => "_________",
  "filters" => $filters,
  "contents" => $content,
);

Thanks in advance

I tried to send from onesignal dashboard it worked just fine ! but I can't from the script .. I guess im missing something ? please any idea?

All 10 comments

The problem solved by adding

'headings' => array('en' => 'Whatever title')
Thanks 馃憤

Hi @mustafa96m ,

Thank you for reporting this issue. Looking into it right now as headings are not required and the app should not crash in their absence.

Hi @JKalash ,

No problem at all , Can't wait to update 馃槃

Thanks

@mustafa96m

Please try the following code and let me know if it crashes as I was not able to reproduce the bug with the following code.

Also one other thing, you are mentioning a crash happening in getPushTitleBody method which only gets called in order to display our native alert view. However displaying an alert view does not happen if you app is cold started from a tap on a notification.

It's actually not crashing on iOS 9 or 10 .. only on 8 .. though I can't test it meanwhile cause the issue reported by a user you know the hassle 馃槅 But once we added the headings thing to php array everything worked just fine ! and we were using the same code you published to us which worked fine too with 10 and 9 but not 8.
Once I get my hands on an iOS 8 device sure I will do and report back here .. but I can't promise anytime soon

Thanks Again

@mustafa96m sounds good. One other thing, I had a look into your call stack and saw that you're not using the latest version of the OneSignal SDK since:
5 ________ 0x3b8f9b +[OneSignalHelper getPushTitleBody:] (OneSignalHelper.m:219)

Cannot have been called from line 219 in OneSignalHelper with the latest version. Make sure you update to the latest 2.1.15 version before trying again.

Cheers!

I'm actually using cocoapods without specifying a version in podfile shouldn't it download the latest one?

@mustafa96m No, unless you run a pod update. The pod install * will fetch the latest version at the time of installation. However we update our SDK very regularly so you should always make sure to run a *pod update every now and then.

Cheers!

I'm seeing this same thing, only when the app is already running, not when launching from the background. iOS10 2.1.16. I'm also not sending a header with my push...

[OneSignalHelper getPushTitleBody:]
[OneSignal notificationOpened:isActive:]
[OneSignal userNotificationCenter:willPresentNotification:withCompletionHandler:]:

I can confirm that by setting the headings field with some data doesn't cause the same crash.

Same issue here.

Was this page helpful?
0 / 5 - 0 ratings