iOS Push Notification Custom Alert

ε祈祈猫儿з 提交于 2020-01-24 17:33:05

问题


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?

Thanks


回答1:


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

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.




回答2:


When you incorporate push notifications into the app - it automatically asks the user if they want to allow push notifications. There is no need for you to create your own custom alert.



来源:https://stackoverflow.com/questions/31656775/ios-push-notification-custom-alert

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!