zo0r / react-native-push-notification

React Native Local and Remote Notifications
MIT License
6.73k stars 2.05k forks source link

JSON value '<null>' of type NSNull cannot be converted to NSDictionary #843

Closed vikrantnegi closed 4 years ago

vikrantnegi commented 5 years ago

Description

I'm using the example project files in my project to test the notifications and it is working fine in Android.

But on iOS, I'm getting this error

JSON value '<null>' of type NSNull cannot be converted to NSDictionary

whenever I'm clicking on local as well as schedule notification. Although It is working fine and I'm receiving the notification but I'm getting this error every time I'm clicking on them.

img_0196

Details

"react-native-push-notification": "^3.1.1", "react": "16.4.1", "react-native": "0.56.0",

vygandas commented 5 years ago

Same here.

efstathiosntonas commented 5 years ago

same here

jriiringan commented 5 years ago

i tried to fix this by passing an empty object on userInfo instead of null value for notification.

vikrantnegi commented 5 years ago

@jriiringan I'm getting the same error. Were you able to fix it using that?

jriiringan commented 5 years ago

@vikrantnegi yes i did. the default example send "null" value so i replace it by an Object.

SCJMENGMENG commented 5 years ago

Modify the NotifService's "category" to be a string,'userInfo'to be a dictionary, and'number' to be a number.

anhvd commented 5 years ago

@SCJMENGMENG s thank for your answer, that's true.

hungdev commented 5 years ago

@SCJMENGMENG it's worked for me. thank u.

e1016 commented 4 years ago

In my case, for future references, the problemas was a null value for Image uri getted from server

<Image source={{ uri: data }}> <- data is null

Dallas62 commented 4 years ago

I fixed the README and example application.

kovkev commented 2 years ago

Has anyone gotten react-native-push-notification working with node-pushnotifications ?

I try to get node-pushnotification to send a push notification to my app, which shows a push notification on ios, but then when I click on it (react-native-push-notification is handling here), then I get the same error as above:

JSON value '<null>' of type NSNull cannot be converted to NSString

kovkev commented 2 years ago

It was happening because I did

PushNotification.cancelLocalNotification({ id: notification.data.notificationId });