如果被拒绝,如何询问通知权限? [英] How to ask notifications permissions if denied?

查看:63
本文介绍了如果被拒绝,如何询问通知权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我想在我的家庭控制器中第二次请求许可,我可以以编程方式进行吗?

I want ask permission in the second time in my home controller for example, can I do it programmatically?

我的意思是我的用户第一次禁用了它,我不想让他有其他选择来获得通知.

What I mean that's my user disable it in the first time and I wan't to allow him another option to get notification.

推荐答案

这实际上是不可能的.您只有一次机会来提示他们授予权限.这就是为什么大多数应用程序会显示自定义视图来解释为什么需要某种权限.如果用户单击是",则他们会启动实际的权限警报.如果他们已经拒绝了权限,您需要检查应用是否具有特定权限,并提示他们进入设置以激活所需内容.

This is actually not possible. You only get one shot to prompt them for permissions. This is why most apps will present a custom view to explain why a certain permission is needed. And if the user clicks "yes", then they launch the actual permission alert. If they have already declined the permission, you'll need to check if app has certain permission and prompt them to go into settings to activate what is needed.

这是一个示例,说明如何检查他们是否已授予权限.

Here's an example of how you can check if they have given permission.

这篇关于如果被拒绝,如何询问通知权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆