如何显示iOS推送通知弹出窗口? [英] How to show iOS Push Notification Popup?

查看:888
本文介绍了如何显示iOS推送通知弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试向我的应用添加推送通知。我需要知道如何显示推送通知弹出窗口。
我所关注的弹出窗口是一个警报视图,有两个选项,允许和不允许。它询问用户是否允许应用程序接收通知和内容。

I'm trying to add push notification to my app. I need to know how to make the push notification popup appear. The popup I'm pertaining to is an alert view that has two choices, "allow" and "don't allow". It asks the user whether to allow the app to receive notifications and stuff or not.

我试过一遍又一遍地删除我的应用程序并推进时间但没有任何效果。

I've tried deleting my app over and over again and advancing the time but nothing worked.

,如果出现弹出窗口,我如何知道所选用户是否不允许/允许?

Also, in case the popup appears, how can I know if the user selected don't allow/ allow?

推荐答案


重置iOS上的推送通知权限警告

Resetting the Push Notifications Permissions Alert on iOS

第一次启用推送的应用程序注册推送通知时,
iOS会询问用户是否希望接收该应用程序的通知。
一旦用户响应此提醒,除非设备已恢复或已卸载应用程序且每天至少花费
,否则不再显示

The first time a push-enabled app registers for push notifications, iOS asks the user if they wish to receive notifications for that app. Once the user has responded to this alert it is not presented again unless the device is restored or the app has been uninstalled for at least a day.

如果您想模拟首次运行的应用程序,可以将
的应用程序卸载一天。你可以通过以下步骤实现后者而不需要
实际等待一天:

If you want to simulate a first-time run of your app, you can leave the app uninstalled for a day. You can achieve the latter without actually waiting a day by following these steps:

1. Delete your app from the device.

2. Turn the device off completely and turn it back on.

3. Go to Settings > General > Date & Time and set the date ahead a day or more.

4. Turn the device off completely again and turn it back on.


来源

这篇关于如何显示iOS推送通知弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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