NativeScript / NativeScript/firebase
[messaging-core] Problems with requesting permissions on Android 33
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 62
- 派生
- 53
- 平均合并
- 8 天 4 小时
- 30 天内合并 PR
- 2
描述
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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 packages/firebase-messaging-core/index.android.ts 的第 314-319 行开始,使用 issue 中的示例调用跟踪 Android 33 的 requestPermission 路径。将其被拒绝时的行为与报告者描述的 iOS 实现进行比较。当已了解模拟器或设备上的行为,并且被拒绝权限的结果与所述的跨平台预期一致时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android, firebase, typescript
- 领域
- mobile
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100