iOS 推送通知自定义提醒 [英] iOS Push Notification Custom Alert

查看:107
本文介绍了iOS 推送通知自定义提醒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 iOS 应用中启用推送通知.我想创建一个自定义警报来询问用户是否要启用通知.苹果是否允许/可能实施?

I am trying to enable push notifications in my iOS app. I wanted to create a custom alert to ask the user if they want to enable the notifications. Does apple allow this/possible to implement?

谢谢

推荐答案

当您 注册 通知,将出现一个弹出窗口,要求用户授予权限(除非他/她之前已经授予权限):

When you register for notifications, a popup will appear asking the user for permission (unless he/she already gave permission before):

第一次调用 registerUserNotificationSettings: 方法时,iOS 会显示一个对话框,询问用户是否允许显示应用注册的通知类型.

The first time you call the registerUserNotificationSettings: method, iOS presents a dialog that asks the user for permission to present the types of notifications the app registered.

不能使用自定义警报,例如当您请求使用用户的位置或他/她的联系人的许可时.这个问题有一个很好的链接,您可以在其中找到您可以的权限提醒自定义.

You cannot use a custom alert, like for instance when you ask for permission to use the user's location, or his/her contacts. This question has a nice link where you can find which permission alerts you can customize.

这篇关于iOS 推送通知自定义提醒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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