允许用户激活推送通知(iOS,React Native)

发布于 2025-01-18 02:27:04 字数 266 浏览 3 评论 0原文

问题:用户最初选择不在应用程序中激活它们后,无法激活推送通知。

当用户首先输入应用程序时,显示了带有2个按钮的模式,用户可以接受以接收推送通知或以后进行。

激活按钮使用“ pushNotificationios.requeStpermissions();”;按预期工作,“稍后激活”按钮无济于事。 问题在于,如果用户选择“以后”,则用户以后无法进入手机应用程序设置以激活推送通知。

我可以激活该设置(以便用户可以在以后的某个时候手动激活它),而无需提示用户使用本机通知对话框?

Problem: Users can't activate push notifications after they initially has chosen not to activate them in the app.

When a user first enter the app, a modal is shown with 2 buttons, where the user can accept to recieve push notifications or to do it later.

The activate button uses "PushNotificationIOS.requestPermissions();" which works as intended, the "activate later" button does nothing.
The problem is that if the user choses "later", the user cannot later go into the phones app settings to activate push notifications.

Can I activate that setting (so the user can manually activate it sometime later) without prompting the user with the native notifications dialog?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眉目亦如画i 2025-01-25 02:27:04

在调用requestPermissions之后,通知设置才出现在应用程序设置中。他们使用户有机会更改他们批准(或拒绝)的设置。

显示您自己的对话框是多余的,因为当您请求通知权限时,操作系统将无论如何都会显示对话框。

您可以显示一个信息屏幕,该屏幕提供有关您的应用程序将发送的通知或启用通知的好处的详细信息,但是您应该只调用request> requestPermissions ,然后让用户响应本机对话框

The notification settings do not appear in the app settings until after you call requestPermissions. They give the user a chance to change the settings that they have approved (or denied).

Showing your own dialog is redundant, since the operating system will show a dialog anyway when you request notification permissions.

You can show an information screen that provides details about the notifications your app will send or the benefits of enabling notifications, but then you should just call requestPermissions and let the user respond to the native dialog

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文