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

Commit 67c5dde

Browse files
committed
Merge commit '9ca18b1e575f2c71cde4b74a929041e55bec3c78' into dev
* commit '9ca18b1e575f2c71cde4b74a929041e55bec3c78': Add help about local notifications problems
2 parents ee6a62e + 9ca18b1 commit 67c5dde

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

trouble-shooting.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,31 @@ Known bugs and issues:
77
* (Android) Tapping an alert in the notification centre will sometimes not result in `onNotification` being called [issue 281](https://github.com/zo0r/react-native-push-notification/issues/281)
88
* (Android) Not all local notification features are supported yet (PRs welcome)
99
* (iOS) The OS can penalise your app for not calling the completion handler and will stop (or delay) sending notifications to your app. This will be supported from RN-0.38 [PR 227](https://github.com/zo0r/react-native-push-notification/pull/277)
10+
* (Android and iOS) Don't use a string to get the date for schedule a local notification, it only works with remote debugger enabled, [explanation](https://stackoverflow.com/a/41881765/8519917).
11+
12+
13+
```javascript
14+
// It doesn't works with the javascript engine used by React Native
15+
const date = new Date("10-10-2020 12:30");
16+
```
17+
A good practice to get valid date could be:
18+
19+
```javascript
20+
// Get date to schedule a local notification today at 12:30:00
21+
const hour = 12;
22+
const minute = 30;
23+
const second = 0;
24+
25+
const now = new Date();
26+
const date = new Date(
27+
now.getFullYear(),
28+
now.getMonth(),
29+
now.getDate(),
30+
hour,
31+
minute,
32+
second
33+
);
34+
```
1035

1136
# Android tips
1237

0 commit comments

Comments
 (0)