简体   繁体   English

iOS - 设置用删除推送通知的新版本覆盖旧版本时无法删除推送通知权限

[英]iOS - Unable to remove push notification permission when setting overwrites old version with new version which removed push notifications

I built an app with push notifications added (version 1.0), I have them installed and allow to receive notifications when the permission popup appears and that permission appears in the app's settings.我构建了一个添加了推送通知的应用程序(1.0 版),我安装了它们并允许在权限弹出窗口出现并且该权限出现在应用程序的设置中时接收通知。

img: allow-push-notification img:允许推送通知

I received a request to remove push notifications from the current app.我收到了从当前应用程序中删除推送通知的请求。 I have removed the push notification capability (.entitlements file) and removed the source implementation of registration, show notification but when I use xcode to overwrite app ver 1.0, the permission to receive notifications still exists in settings.我已经删除了推送通知功能(.entitlements 文件)并删除了注册的源实现,显示通知但是当我使用 xcode 覆盖应用程序版本 1.0 时,接收通知的权限仍然存在于设置中。 Only when I remove the old app and install the new one does it disappear.只有当我删除旧应用程序并安装新应用程序时,它才会消失。

Is there any solution that can help me to remove the notification permission without having to delete the app and reinstall it?是否有任何解决方案可以帮助我删除通知权限而无需删除应用程序并重新安装它?

Thanks for the solutions from everyone!感谢大家的解决方案!

There are two different things here;这里有两个不同的东西;

One is an entitlement to register for push notifications.一个是注册推送通知的权利。

The second is permission from the user to show notifications (whether local or remote).第二个是用户允许显示通知(无论是本地的还是远程的)。

Your app can include the push notification entitlement but not ask the user for notification permissions.您的应用程序可以包含推送通知权利,但不要求用户提供通知权限。 This allows your app to receive "silent" notifications, to trigger a data refresh, for example.例如,这允许您的应用接收“静默”通知,以触发数据刷新。

Once your app has asked the user for permission to display notifications (whether you intend to show local or remote) the notification settings will show in the app settings.一旦您的应用程序请求用户允许显示通知(无论您打算显示本地还是远程),通知设置将显示在应用程序设置中。 This cannot be removed, except by the user removing your app and reinstalling it这无法删除,除非用户删除您的应用并重新安装它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM