Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

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

Closed
vikrantnegi opened this issue Aug 24, 2018 · 12 comments
Closed

Comments

@vikrantnegi
Copy link
Contributor

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
Copy link

Same here.

@efstathiosntonas
Copy link

same here

@jriiringan
Copy link

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

@vikrantnegi
Copy link
Contributor Author

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

@jriiringan
Copy link

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

@SCJMENGMENG
Copy link

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

@anhvd
Copy link

anhvd commented Oct 11, 2018

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

@hungdev
Copy link

hungdev commented Dec 27, 2018

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

@e1016
Copy link

e1016 commented Mar 30, 2020

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 added a commit that referenced this issue Apr 8, 2020
@Dallas62
Copy link
Collaborator

Dallas62 commented Apr 8, 2020

I fixed the README and example application.

@Dallas62 Dallas62 closed this as completed Apr 8, 2020
@kovkev
Copy link

kovkev commented Apr 5, 2022

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
Copy link

kovkev commented Apr 9, 2022

It was happening because I did

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants