Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS 7.1.2][0.29.0] RCTPushNotificationManager throws NSInvalidArgumentException [UIConcreteLocalNotification category] #8662

Closed
jan-happy opened this issue Jul 8, 2016 · 7 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@jan-happy
Copy link

jan-happy commented Jul 8, 2016

Tested my app on an old iPhone 4 with the latest iOS Version for it.
Runs fine on other devices with iOS 8&9, but raises this exception on iOS 7.1.2

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIConcreteLocalNotification category]: unrecognized selector sent to instance 0x15df9cb0'

Commenting out line 45 and 75 in RCTPushNotificationManager.m fixed it for me since I don't need categories in my local push notifications.

45 //notification.category = [RCTConvert NSString:details[@"category"]];
75 //formattedLocalNotification[@"category"] = RCTNullIfNil(notification.category);
@Dean177
Copy link

Dean177 commented Aug 8, 2016

I am having the same problem. Does iOS 7.1.2 not support categories for notifications?

@jan-happy
Copy link
Author

Yes, categories came with iOS 8. Could anyone patch this? Right now, Notifications are unusable in iOS 7.

@Dean177
Copy link

Dean177 commented Aug 17, 2016

I have absolutely no idea what i am doing in objective-c, but would something like:

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
    notification.category = [RCTConvert NSString:details[@"category"]];
}

...

if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
    formattedLocalNotification[@"category"] = RCTNullIfNil(notification.category);
}

be sufficient?

@jan-happy
Copy link
Author

Yes, that should do it!
Could maybe @corbt or @nicklockwood look into it? It totally breaks PushNotifications under iOS 7.
Thank you!

@corbt
Copy link
Contributor

corbt commented Aug 24, 2016

Sorry @jan-happy, only have time for dealing with my own bugs for the moment. :) Agree this should be fixed though!

@Dean177
Copy link

Dean177 commented Sep 23, 2016

@jan-happy It looks like this is now moot. React native v0.34 drops iOS 7 support: 07553d0

@ericnakagawa
Copy link
Contributor

Hi @jan-happy, I'm closing this issue since RN no longer supports iOS 7. Were you able to find a suitable workaround?

@facebook facebook locked as resolved and limited conversation to collaborators Jul 19, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants