It seems [OneSignal initWithLaunchOptions:appId:handleNotificationAction:settings:] crashes on iOS 7 since release > 2.3.5.
It's fixed if you in OneSignal.m replace
else
[self registerForAPNsToken];
with
else if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerForRemoteNotifications)])
[self registerForAPNsToken];
But would that break push notification delivery on iOS 7 for some users?
Stack trace with release 2.3.7.
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x2ee69fd3 __exceptionPreprocess
1 libobjc.A.dylib 0x396e2ccf objc_exception_throw
2 CoreFoundation 0x2ee6d967 -[NSObject(NSObject) doesNotRecognizeSelector:]
3 CoreFoundation 0x2ee6c253 ___forwarding___
4 CoreFoundation 0x2edbb7b8 _CF_forwarding_prep_0
5 Fanmiles 0x4516cb +[OneSignal registerForAPNsToken] (OneSignal.m:358)
6 Fanmiles 0x450c07 +[OneSignal initWithLaunchOptions:appId:handleNotificationReceived:handleNotificationAction:settings:] (OneSignal.m:230)
7 Fanmiles 0x45002d +[OneSignal initWithLaunchOptions:appId:handleNotificationAction:settings:] (OneSignal.m:159)
@adambolcsfoldi Thanks for the report! Just fixed the issue in commit 5973c56ffd85000d00c14599148e514aa54deef7 along with a unit test for it. We will be releasing SDK 2.4.1 with this fix included.
I'll reply here when the release is available for you to try out.
@adambolcsfoldi This is now available. Let us know if the 2.4.1 update fixes the issue for you or not.
Seems to have fixed it 馃憤
@adambolcsfoldi Awesome! Thanks for checking