question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

details.date.toISOString is not a function

See original GitHub issue

Hello guys , i implemented the push notification in my project but i always get this problem simulator screen shot jun 30 2017 12 04 37 pm

here’s my code :

`componentDidMount(){ codePush.sync({ updateDialog: true, installMode: codePush.InstallMode.IMMEDIATE })

let date = new Date(Date.now() + (6 * 1000));

PushNotification.localNotificationSchedule({
  message: "My Notification Message", // (required)
  date: (Platform.OS === 'ios') ? date.toISOString() : date // in 60 secs
})

}`

Note that i only get this problem on ios , android is working fine

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
varungupta85commented, Jun 30, 2017

Don’t set date as date.toISOString(). Send the date object as is for both iOS and Android. So, do

let date = new Date(Date.now() + (6 * 1000));

PushNotification.localNotificationSchedule({
  message: "My Notification Message", // (required)
  date: date // in 60 secs
})
5reactions
varungupta85commented, Jul 1, 2017

Do you guys have the latest version? This may be related to the number field not set in the details object which was fixed in this commit https://github.com/zo0r/react-native-push-notification/commit/6a4f70fa3754e511a7dfad4c86ae58db169e3c79#diff-168726dbe96b3ce427e7fedce31bb0bc

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Solved] TypeError: toISOString is not a function - ItsJavaScript
The TypeError: toISOString is not a function occurs if we call a toISOString() method on the object that is not of type Date...
Read more >
Date.now().toISOString() throwing error "not a function"
Date.now() returns a number which represents the number of milliseconds elapsed since the UNIX epoch. The toISOString method cannot be called on a...
Read more >
Bug: value.toISOString is not a function #29 - GitHub
I am getting following error when quering for an object with an iso date field: serialize(value: Date) { return value.toISOString(); } ...
Read more >
js toisostring is not a function Code Example - Code Grepper
1. Date.now() returns a number which represents the number of milliseconds elapsed since the UNIX epoch. The toISOString method cannot be called on...
Read more >
toISOString() function not working. - jQuery Forum
I want to convert the date string into ISO date format which is compatible with firefox. However its not working in Jquery.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found