NativeScript / NativeScript/plugins

@nativescript/local-notifications custom sound not working

Đang mở
#259 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

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

Mô tả

Hi All, I've been trying to look out for a solution on the internet, and even tried to understand the source code with no avail.

I'm trying to schedule a local notifications as follows

LocalNotifications.schedule([ {
            id: id,
            title: `Some title`,
            sound: 'res://silent.wav',
            ongoing: true,
            notificationLed: false,
            forceShowWhenInForeground: false,
            priority: 0,
            actions: actions,
            icon: 'res://icon',
        } ])

and the notification is displayed correctly. And that's fine. The only problem is that the sound file which I am specifying is not being played, and instead the default android notification sound of the device is playing.

I've even tried using silent.wav and silent as values... I even tried passing <any>null as indicated in the README but nothing worked.

The silent.wav file is located in App_Resources/Android/src/main/res/raw and App_Resources/iOS respectively

Something worth mentioning is that I've been trying this out on Android 11.

Any help and pointers would be greatly appreciated.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với README của local-notifications và phần triển khai Android, sử dụng lệnh gọi lên lịch đã được báo cáo và Android 11 làm trường hợp tái hiện. Kiểm tra cách giá trị từ App_Resources/Android/src/main/res/raw/silent.wav được xử lý; được coi là hoàn tất khi thông báo đã lên lịch phát âm thanh tùy chỉnh được chỉ định thay vì âm thanh mặc định của thiết bị.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, typescript
Lĩnh vực
mobile-dev
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.