NativeScript / NativeScript/firebase
[messaging-core] Problems with requesting permissions on Android 33
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 62
- Fork
- 53
- Merge trung bình
- 8 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 2
Mô tả
I'm trying to migrate from the old firebase plugin to this one, and I'm getting some strange problem testing on a simulator with API 33. As soon as I call the request permissions, I do not get any prompts and I get a rejection. Here is a sample code:
export async function onTap() {
try {
const result = await MessagingCore.getInstance().requestPermission();
console.log("RES", result);
}
catch (e) {
console.error("ERROR", e);
}
}
From what I see it is because of this:
https://github.com/NativeScript/firebase/blob/889726640381cb4a0cdbe855f658ff3245a0eb3d/packages/firebase-messaging-core/index.android.ts#L314-L319
Does requesting permissions for notifications work only on physical devices?
Also why does this code reject while the iOS code resolves even if permission is denied but with the correct status code? Shouldn't this be changed to resolve(AuthorizationStatus.DENIED) for better cross platform interoperability? Right now I have to surround the request call with an empty try/catch to simulate similar behavior as on iOS.
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.
Hướng nghiên cứu
Bắt đầu với packages/firebase-messaging-core/index.android.ts tại các dòng 314-319 và lần theo luồng requestPermission của Android 33 bằng cách sử dụng lời gọi mẫu trong issue. So sánh hành vi khi bị từ chối với phần triển khai iOS được người báo cáo mô tả. Được xem là hoàn tất khi đã hiểu hành vi trên trình giả lập hoặc thiết bị và kết quả quyền bị từ chối nhất quán với kỳ vọng đa nền tảng đã nêu.
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, firebase, typescript
- Lĩnh vực
- mobile
- 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
- 35/100