[@nativescript/local-notifications] Schedule not work on iOS with Buddhist calendar
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- ios, javascript, typescript
- Lĩnh vực
- mobile-dev
Hướng nghiên cứu
Bắt đầu trong index.ios.js tại LocalNotificationsImpl.schedulePendingNotificationsNew(), sau đó kiểm tra calendarWithMondayAsFirstDay() và cách xây dựng trigger được trình bày trong báo cáo. Tái hiện trên iOS 14.4 với lịch Phật giáo được bật và xác minh rằng schedule() tạo ra một thông báo hoạt động, đồng thời giữ nguyên hành vi lặp hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Dear sir,
I had upgraded my app to NativeScript 7 and the notification (@nativescript/local-notifications, version 5.1.0) does not work on iOS (14.4). After debugging all day, I found that LocalNotifications.schedule() not work because my iPhone is set the calendar to Buddhist.
The bug is in the index.ios.js file, in the method schedulePendingNotificationsNew() of class LocalNotificationsImpl as part of code below:
// Notification trigger and repeat
let trigger;
if (options.at) {
const cal = NSCalendar.currentCalendar; //LocalNotificationsImpl.calendarWithMondayAsFirstDay();
const date = cal.componentsFromDate(LocalNotificationsImpl.getInterval(options.interval), options.at);
date.timeZone = NSTimeZone.defaultTimeZone;
trigger = UNCalendarNotificationTrigger.triggerWithDateMatchingComponentsRepeats(date, options.interval !== undefined);
}
else {
trigger = UNTimeIntervalNotificationTrigger.triggerWithTimeIntervalRepeats(2, false);
}
At the line 137, the LocalNotificationsImpl.calendarWithMondayAsFirstDay() which return ISO8601 (Gregorian) calendar make a wrong matching trigger. So, I change the code to use the NSCalendar.currentCalendar and It work well.
- Ngôn ngữ chính
- TypeScript
- Star
- 206
- Fork
- 123
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NativeScript/plugins
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
NativeScript/plugins#680 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NativeScript/plugins#671 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
NativeScript/plugins#640 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
NativeScript/plugins#668 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
NativeScript/plugins#665 · 1 bình luận ·
Tất cả issue của NativeScript/plugins
Issue tương tự
-
Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OpenNSW/nsw-srilanka#497 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
0xMiden/bridge-portal#132 ·
-
react-doctor severity:warning tech-debt
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
digidem/comapeo-cloud-app#403 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100